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
This commit is contained in:
Tom Cherry
2017-02-28 14:07:09 -08:00
parent 3e64003641
commit 298a146754
4 changed files with 10 additions and 3 deletions

View File

@@ -345,7 +345,9 @@ void RenderThread::queueAndWait(RenderTask* task) {
AutoMutex _lock(mutex);
queue(&syncTask);
condition.wait(mutex);
while (!syncTask.hasRun()) {
condition.wait(mutex);
}
}
void RenderThread::queueAtFront(RenderTask* task) {