diff options
author | Tom Cherry <tomcherry@google.com> | 2017-02-28 14:07:09 -0800 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2017-02-28 14:19:44 -0800 |
commit | 298a146754e35cbc650aa991ebff1a41eefdbe80 (patch) | |
tree | 8c1c847d9c42f13460e3d09e84435f9d4ce2195e /libs/hwui/renderthread/RenderThread.cpp | |
parent | 3e64003641c376573f4809aae79febd0187be81e (diff) |
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
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderThread.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp index 9c10c4fdbad1..f383adc9f644 100644 --- a/libs/hwui/renderthread/RenderThread.cpp +++ b/libs/hwui/renderthread/RenderThread.cpp @@ -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) { |