From c353ec205d3bc2a30335837b630c3de17c674114 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 21 Jun 2016 18:17:41 +1200 Subject: layers: Fix locking in ResetCommandPool This got broken when some code moved around Signed-off-by: Chris Forbes --- layers/core_validation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index bfb758b7..90695f55 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -5460,8 +5460,10 @@ ResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetF layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); bool skipCall = false; + std::unique_lock lock(global_lock); auto pPool = getCommandPoolNode(dev_data, commandPool); skipCall |= checkCommandBuffersInFlight(dev_data, pPool, "reset command pool with"); + lock.unlock(); if (skipCall) return VK_ERROR_VALIDATION_FAILED_EXT; @@ -5470,11 +5472,12 @@ ResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetF // Reset all of the CBs allocated from this pool if (VK_SUCCESS == result) { - std::lock_guard lock(global_lock); + lock.lock(); clearCommandBuffersInFlight(dev_data, pPool); for (auto cmdBuffer : pPool->commandBuffers) { resetCB(dev_data, cmdBuffer); } + lock.unlock(); } return result; } -- cgit v1.2.3