Add locking to signal in AudioCache::notify(). Bug 2317844.

This commit is contained in:
Dave Sparks
2010-03-01 19:29:58 -08:00
parent 14b60e747c
commit 16433e2fe3

View File

@@ -1768,7 +1768,7 @@ ssize_t MediaPlayerService::AudioCache::write(const void* buffer, size_t size)
status_t MediaPlayerService::AudioCache::wait()
{
Mutex::Autolock lock(mLock);
if (!mCommandComplete) {
while (!mCommandComplete) {
mSignal.wait(mLock);
}
mCommandComplete = false;
@@ -1805,6 +1805,7 @@ void MediaPlayerService::AudioCache::notify(void* cookie, int msg, int ext1, int
}
// wake up thread
Mutex::Autolock lock(mLock);
p->mCommandComplete = true;
p->mSignal.signal();
}