summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-09-24 15:02:17 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-25 09:40:00 -0700
commit67d8ac3a8b49b114366684cd6310493423581056 (patch)
tree2e44b42fa993f87681218453705dc0b67da25c24 /services
parent2eddc1d2f99fb280786e30ec91f3c5df78556166 (diff)
downloadframeworks_av-67d8ac3a8b49b114366684cd6310493423581056.zip
frameworks_av-67d8ac3a8b49b114366684cd6310493423581056.tar.gz
frameworks_av-67d8ac3a8b49b114366684cd6310493423581056.tar.bz2
audioflinger: improve record start and thread exit
Use broadcast() instead of signal() on the thread wake up condition when starting record or requesting thread exit to make sure that if another thread is waiting for the same condition (e.g binder thread calling setParameters()) the mixer thread will be woken up. Bug 7184317. Change-Id: I3154a4509ca7af6ffae5236e522b0fab8e75ed06
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioFlinger.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 8e950aa..dd491f5 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1175,7 +1175,7 @@ void AudioFlinger::ThreadBase::exit()
// }
AutoMutex lock(mLock);
requestExit();
- mWaitWorkCV.signal();
+ mWaitWorkCV.broadcast();
}
// When Thread::requestExitAndWait is made virtual and this method is renamed to
// "virtual status_t requestExitAndWait()", replace by "return Thread::requestExitAndWait();"
@@ -6323,7 +6323,7 @@ status_t AudioFlinger::RecordThread::start(RecordThread::RecordTrack* recordTrac
mActiveTrack->mState = TrackBase::RESUMING;
// signal thread to start
ALOGV("Signal record thread");
- mWaitWorkCV.signal();
+ mWaitWorkCV.broadcast();
// do not wait for mStartStopCond if exiting
if (exitPending()) {
mActiveTrack.clear();