summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-12-17 22:06:10 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-12-17 22:06:10 +0000
commitf81f7a52d4720f441197f75918d2b2c05d41ab45 (patch)
treefa56f9fbc01da9bfca3814af80c63e7857bfa2fd
parent645e43977d3aabc5addab022d772accc32fd5bdc (diff)
parentc95616357a911e5c1c55873492b05ebfa3cf1894 (diff)
downloadframeworks_av-f81f7a52d4720f441197f75918d2b2c05d41ab45.zip
frameworks_av-f81f7a52d4720f441197f75918d2b2c05d41ab45.tar.gz
frameworks_av-f81f7a52d4720f441197f75918d2b2c05d41ab45.tar.bz2
Merge "audioflinger: check for condition before waiting"
-rw-r--r--services/audioflinger/Threads.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 45926b4..2f71db7 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -3861,7 +3861,12 @@ bool AudioFlinger::AsyncCallbackThread::threadLoop()
{
Mutex::Autolock _l(mLock);
- mWaitWorkCV.wait(mLock);
+ while (!((mWriteAckSequence & 1) ||
+ (mDrainSequence & 1) ||
+ exitPending())) {
+ mWaitWorkCV.wait(mLock);
+ }
+
if (exitPending()) {
break;
}