Skip to content

Commit 0d07b6a

Browse files
gkastenAndroid (Google) Code Review
authored andcommitted
Merge "Fix theoretical race condition in addOutputTrack"
2 parents 2b119a6 + 91540ae commit 0d07b6a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

services/audioflinger/AudioFlinger.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3239,6 +3239,7 @@ bool AudioFlinger::DuplicatingThread::threadLoop()
32393239

32403240
void AudioFlinger::DuplicatingThread::addOutputTrack(MixerThread *thread)
32413241
{
3242+
Mutex::Autolock _l(mLock);
32423243
// FIXME explain this formula
32433244
int frameCount = (3 * mFrameCount * mSampleRate) / thread->sampleRate();
32443245
OutputTrack *outputTrack = new OutputTrack(thread,

0 commit comments

Comments
 (0)