SF: make RenderEngineThreaded::waitUntilInitialized more efficient
RenderEngineThreaded::waitUntilInitialized is called from multiple
threads. Use atomic to avoid contending on a mutex.
Bug: 313924033
Test: presubmit
Change-Id: I4d61240a76f3ca814c28ccba62626f8b43a125cd
diff --git a/libs/renderengine/threaded/RenderEngineThreaded.h b/libs/renderengine/threaded/RenderEngineThreaded.h
index 74af2bd..3f1e67f 100644
--- a/libs/renderengine/threaded/RenderEngineThreaded.h
+++ b/libs/renderengine/threaded/RenderEngineThreaded.h
@@ -97,7 +97,7 @@
// Used to allow select thread safe methods to be accessed without requiring the
// method to be invoked on the RenderEngine thread
- bool mIsInitialized = false;
+ std::atomic_bool mIsInitialized = false;
mutable std::mutex mInitializedMutex;
mutable std::condition_variable mInitializedCondition;