From 8acfb0933fa04e7491126c6849210324a85fec58 Mon Sep 17 00:00:00 2001 From: Mike Stroyan Date: Thu, 30 Jun 2016 13:21:37 -0600 Subject: layers: Use type-specific mutexes in thread layer Use type-specific mutexes to reduce lock contention. --- layers/threading.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'layers/threading.cpp') diff --git a/layers/threading.cpp b/layers/threading.cpp index c69a8b62..d98aa1cb 100644 --- a/layers/threading.cpp +++ b/layers/threading.cpp @@ -318,7 +318,7 @@ AllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllo // Record mapping from command buffer to command pool if (VK_SUCCESS == result) { for (uint32_t index = 0; index < pAllocateInfo->commandBufferCount; index++) { - std::lock_guard lock(global_lock); + std::lock_guard lock(command_pool_lock); command_pool_map[pCommandBuffers[index]] = pAllocateInfo->commandPool; } } @@ -343,7 +343,7 @@ VKAPI_ATTR void VKAPI_CALL FreeCommandBuffers(VkDevice device, VkCommandPool com finishWriteObject(my_data, commandPool); for (uint32_t index = 0; index < commandBufferCount; index++) { finishWriteObject(my_data, pCommandBuffers[index], lockCommandPool); - std::lock_guard lock(global_lock); + std::lock_guard lock(command_pool_lock); command_pool_map.erase(pCommandBuffers[index]); } } -- cgit v1.2.3