summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Threads.cpp
diff options
context:
space:
mode:
authorHaynes Mathew George <hgeorge@codeaurora.org>2013-12-03 21:26:02 -0800
committerEric Laurent <elaurent@google.com>2013-12-17 22:05:51 +0000
commitc95616357a911e5c1c55873492b05ebfa3cf1894 (patch)
treefa56f9fbc01da9bfca3814af80c63e7857bfa2fd /services/audioflinger/Threads.cpp
parent645e43977d3aabc5addab022d772accc32fd5bdc (diff)
downloadframeworks_av-c95616357a911e5c1c55873492b05ebfa3cf1894.zip
frameworks_av-c95616357a911e5c1c55873492b05ebfa3cf1894.tar.gz
frameworks_av-c95616357a911e5c1c55873492b05ebfa3cf1894.tar.bz2
audioflinger: check for condition before waiting
AsyncCallbackThread must check for any condition that has already been satisfied before waiting. Bug: 11824817 Change-Id: Ic8c2090d521ecd6a30b76ee75635258d35eb1eff
Diffstat (limited to 'services/audioflinger/Threads.cpp')
-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;
}