drm_hwcomposer: Make main mutex recursive
It allows to remove redundant unlock/lock pair from the code,
and should make it a little bit more race-proof.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
diff --git a/drm/ResourceManager.cpp b/drm/ResourceManager.cpp
index f64cae4..dd26c17 100644
--- a/drm/ResourceManager.cpp
+++ b/drm/ResourceManager.cpp
@@ -82,7 +82,7 @@
}
uevent_listener_->RegisterHotplugHandler([this] {
- const std::lock_guard<std::mutex> lock(GetMainLock());
+ const std::unique_lock lock(GetMainLock());
UpdateFrontendDisplays();
});