summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-11-08 10:04:06 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-11-08 10:04:07 -0800
commit4f3ebe4090a3be3bb7622cc01b2f9af476914798 (patch)
treed563e9b5c676b176832ffb37c5cd0cc2eb00b19a /include
parentba85098eb31bd2637db49816f0591361211024f2 (diff)
parenta96bd95dcfe886436652debbda77ceb634729da0 (diff)
downloadframeworks_av-4f3ebe4090a3be3bb7622cc01b2f9af476914798.zip
frameworks_av-4f3ebe4090a3be3bb7622cc01b2f9af476914798.tar.gz
frameworks_av-4f3ebe4090a3be3bb7622cc01b2f9af476914798.tar.bz2
Merge "Fix call to restoreTrack_l() without lock held"
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioTrack.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index 529f74e..1a19999 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -481,6 +481,7 @@ protected:
// body of AudioTrackThread::threadLoop()
bool processAudioBuffer(const sp<AudioTrackThread>& thread);
+ // caller must hold lock on mLock for all _l methods
status_t createTrack_l(audio_stream_type_t streamType,
uint32_t sampleRate,
audio_format_t format,
@@ -535,7 +536,13 @@ protected:
audio_output_flags_t mFlags;
int mSessionId;
int mAuxEffectId;
+
+ // When locking both mLock and mCblk->lock, must lock in this order to avoid deadlock:
+ // 1. mLock
+ // 2. mCblk->lock
+ // It is OK to lock only mCblk->lock.
mutable Mutex mLock;
+
status_t mRestoreStatus;
bool mIsTimed;
int mPreviousPriority; // before start()