summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/VulkanManager.cpp
diff options
context:
space:
mode:
authorGreg Daniel <egdaniel@google.com>2021-05-14 09:28:34 -0400
committerGreg Daniel <egdaniel@google.com>2021-05-14 10:42:34 -0400
commit1d9de71ed9b346e2f7ca1817a116b9111788081b (patch)
tree691d6d82dafe9528d2c590f6bdc245e8e99e323b /libs/hwui/renderthread/VulkanManager.cpp
parentf477c8fb75b5d6a57229403fb3a2be9c5e4b93cf (diff)
Add a mutex to VulkanManager::initialize.
The initialize call can be made from both an GrallocUploadThread and the RenderThread. So we need a mutex to make sure both threads don't try to initialize in parallel. Bug: 187218890 Test: manual running of device, guessing this could fix bug. Change-Id: I203afd91fad5eacc131c839dff1a1065864b76f8
Diffstat (limited to 'libs/hwui/renderthread/VulkanManager.cpp')
-rw-r--r--libs/hwui/renderthread/VulkanManager.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/VulkanManager.cpp b/libs/hwui/renderthread/VulkanManager.cpp
index 01126860b3ba..07146e845714 100644
--- a/libs/hwui/renderthread/VulkanManager.cpp
+++ b/libs/hwui/renderthread/VulkanManager.cpp
@@ -340,6 +340,8 @@ void VulkanManager::setupDevice(GrVkExtensions& grExtensions, VkPhysicalDeviceFe
}
void VulkanManager::initialize() {
+ std::lock_guard _lock{mInitializeLock};
+
if (mDevice != VK_NULL_HANDLE) {
return;
}