aboutsummaryrefslogtreecommitdiff
path: root/layers/threading.cpp
diff options
context:
space:
mode:
authorMike Stroyan <stroyan@google.com>2016-06-30 13:21:37 -0600
committerMike Stroyan <stroyan@google.com>2016-07-13 15:28:28 -0600
commit8acfb0933fa04e7491126c6849210324a85fec58 (patch)
treec2512bbe10cde44f1d461e3ac7a62f52801b14d0 /layers/threading.cpp
parent37aa384a979ca831860a3e10255b1c323b68c688 (diff)
downloadusermoji-8acfb0933fa04e7491126c6849210324a85fec58.tar.xz
layers: Use type-specific mutexes in thread layer
Use type-specific mutexes to reduce lock contention.
Diffstat (limited to 'layers/threading.cpp')
-rw-r--r--layers/threading.cpp4
1 files changed, 2 insertions, 2 deletions
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<std::mutex> lock(global_lock);
+ std::lock_guard<std::mutex> 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<std::mutex> lock(global_lock);
+ std::lock_guard<std::mutex> lock(command_pool_lock);
command_pool_map.erase(pCommandBuffers[index]);
}
}