summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Threads.cpp
diff options
context:
space:
mode:
authorHaynes Mathew George <hgeorge@codeaurora.org>2014-03-05 20:01:11 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-05 20:01:11 +0000
commitd384a2c44810ce1b51277cc4ab4c5415ff7de6ee (patch)
treec020402fdf9734df5c77b93058b841d9c501a4ef /services/audioflinger/Threads.cpp
parent3cd7a13a7926e210bd8dff65d6f43a257f5235e5 (diff)
parent4f9e38c60cc79407a8b2966b3b9780a3e395b017 (diff)
downloadframeworks_av-d384a2c44810ce1b51277cc4ab4c5415ff7de6ee.zip
frameworks_av-d384a2c44810ce1b51277cc4ab4c5415ff7de6ee.tar.gz
frameworks_av-d384a2c44810ce1b51277cc4ab4c5415ff7de6ee.tar.bz2
am 4f9e38c6: am 21e81bca: am e010f65e: audioflinger: Fix for a deadlock in track creation
* commit '4f9e38c60cc79407a8b2966b3b9780a3e395b017': audioflinger: Fix for a deadlock in track creation
Diffstat (limited to 'services/audioflinger/Threads.cpp')
-rw-r--r--services/audioflinger/Threads.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 498ddb6..f0f5a4d 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -1324,8 +1324,10 @@ sp<AudioFlinger::PlaybackThread::Track> AudioFlinger::PlaybackThread::createTrac
track = TimedTrack::create(this, client, streamType, sampleRate, format,
channelMask, frameCount, sharedBuffer, sessionId, uid);
}
+
if (track == 0 || track->getCblk() == NULL || track->name() < 0) {
lStatus = NO_MEMORY;
+ // track must be cleared from the caller as the caller has the AF lock
goto Exit;
}
@@ -4741,7 +4743,7 @@ sp<AudioFlinger::RecordThread::RecordTrack> AudioFlinger::RecordThread::createR
if (track->getCblk() == 0) {
ALOGE("createRecordTrack_l() no control block");
lStatus = NO_MEMORY;
- track.clear();
+ // track must be cleared from the caller as the caller has the AF lock
goto Exit;
}
mTracks.add(track);