diff options
author | Glenn Kasten <gkasten@google.com> | 2014-06-16 21:57:26 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-06-16 21:57:26 +0000 |
commit | 5094675aa55458414e8b00a86a104a32ea1d55c0 (patch) | |
tree | 7003b2ab12eeebfa9d1fd22adb1e0517f223dfb2 /services | |
parent | 1555a9882179a26ce116dffc920ab0be338db4b8 (diff) | |
parent | a3603693fb784d7e1a820ee4629a69730a0bb424 (diff) | |
download | frameworks_av-5094675aa55458414e8b00a86a104a32ea1d55c0.zip frameworks_av-5094675aa55458414e8b00a86a104a32ea1d55c0.tar.gz frameworks_av-5094675aa55458414e8b00a86a104a32ea1d55c0.tar.bz2 |
am a3603693: Merge "Fix deadlock" into lmp-preview-dev
* commit 'a3603693fb784d7e1a820ee4629a69730a0bb424':
Fix deadlock
Diffstat (limited to 'services')
-rwxr-xr-x | services/audioflinger/Threads.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index c0daa08..d6390b1 100755 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -5139,7 +5139,7 @@ reacquire_wakelock: sleepUs = kRecordThreadSleepUs; } if (framesRead <= 0) { - continue; + goto unlock; } ALOG_ASSERT(framesRead > 0); @@ -5147,10 +5147,12 @@ reacquire_wakelock: (void) mTeeSink->write(&mRsmpInBuffer[rear * mChannelCount], framesRead); } // If destination is non-contiguous, we now correct for reading past end of buffer. - size_t part1 = mRsmpInFramesP2 - rear; - if ((size_t) framesRead > part1) { - memcpy(mRsmpInBuffer, &mRsmpInBuffer[mRsmpInFramesP2 * mChannelCount], - (framesRead - part1) * mFrameSize); + { + size_t part1 = mRsmpInFramesP2 - rear; + if ((size_t) framesRead > part1) { + memcpy(mRsmpInBuffer, &mRsmpInBuffer[mRsmpInFramesP2 * mChannelCount], + (framesRead - part1) * mFrameSize); + } } rear = mRsmpInRear += framesRead; @@ -5358,6 +5360,7 @@ reacquire_wakelock: } +unlock: // enable changes in effect chain unlockEffectChains(effectChains); // effectChains doesn't need to be cleared, since it is cleared by destructor at scope end |