Check for spurious wake ups
Condition::wait() can spuriously wake up, so we must guard it with
another check to ensure that a given wake was truly due to having
been signaled.
Bug: 34592766
Test: Boot bullhead
Change-Id: Iaa5a0ca6186aea50c51e2c402ef95d7ba861be92
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 9c10c4f..f383adc 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -345,7 +345,9 @@
AutoMutex _lock(mutex);
queue(&syncTask);
- condition.wait(mutex);
+ while (!syncTask.hasRun()) {
+ condition.wait(mutex);
+ }
}
void RenderThread::queueAtFront(RenderTask* task) {