summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorHaynes Mathew George <hgeorge@codeaurora.org>2013-12-03 21:26:02 -0800
committerEric Laurent <elaurent@google.com>2014-03-04 16:03:12 -0800
commit50c3157c5a3e0617be77716beff1ae8801d8a72f (patch)
tree7b550f2609351c85fc70658220f14e3a5737288e /services
parente0cd1051ed9fea0629745c29020516ae62298461 (diff)
downloadframeworks_av-50c3157c5a3e0617be77716beff1ae8801d8a72f.zip
frameworks_av-50c3157c5a3e0617be77716beff1ae8801d8a72f.tar.gz
frameworks_av-50c3157c5a3e0617be77716beff1ae8801d8a72f.tar.bz2
audioflinger: check for condition before waiting
AsyncCallbackThread must check for any condition that was already been satisfied before waiting. Bug: 11824817 Change-Id: I04683a1f355de4f440106cab47fd916aa39d5e35
Diffstat (limited to 'services')
-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 64d7ec3..110e45c 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -3863,7 +3863,12 @@ bool AudioFlinger::AsyncCallbackThread::threadLoop()
{
Mutex::Autolock _l(mLock);
- mWaitWorkCV.wait(mLock);
+ while (!((mWriteAckSequence & 1) ||
+ (mDrainSequence & 1) ||
+ exitPending())) {
+ mWaitWorkCV.wait(mLock);
+ }
+
if (exitPending()) {
break;
}