summaryrefslogtreecommitdiffstats
path: root/include/media/AudioSystem.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-11-18 17:26:58 -0800
committerEric Laurent <elaurent@google.com>2014-11-19 09:12:16 -0800
commitf6778fd0c72ab54328f0e9f5ecf0017b73e99dd8 (patch)
tree8f31be289f16ae8d684699ba80d533b249923e18 /include/media/AudioSystem.h
parent35b0f7095fac4f2cc112edd4b0298a9cb1ee394f (diff)
downloadframeworks_av-f6778fd0c72ab54328f0e9f5ecf0017b73e99dd8.zip
frameworks_av-f6778fd0c72ab54328f0e9f5ecf0017b73e99dd8.tar.gz
frameworks_av-f6778fd0c72ab54328f0e9f5ecf0017b73e99dd8.tar.bz2
AudioSystem: Add mutex for output cache
Fix cross deadlock with AudioFlinger by adding a dedicated mutex to protect access to cached output list and parameters. Bug: 18410728. Change-Id: Ia31283b1972d8865a46e84e63695173c187eb781
Diffstat (limited to 'include/media/AudioSystem.h')
-rw-r--r--include/media/AudioSystem.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h
index f3b7fbb..d54eca7 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -373,10 +373,11 @@ private:
friend class AudioFlingerClient;
friend class AudioPolicyServiceClient;
- static Mutex gLock; // protects all members except gAudioPolicyService,
- // gAudioPolicyServiceClient, and gAudioPortCallback
- static Mutex gLockAPS; // protects gAudioPolicyService and gAudioPolicyServiceClient
- static Mutex gLockAPC; // protects gAudioPortCallback
+ static Mutex gLock; // protects gAudioFlinger and gAudioErrorCallback,
+ static Mutex gLockCache; // protects gOutputs, gPrevInSamplingRate, gPrevInFormat,
+ // gPrevInChannelMask and gInBuffSize
+ static Mutex gLockAPS; // protects gAudioPolicyService and gAudioPolicyServiceClient
+ static Mutex gLockAPC; // protects gAudioPortCallback
static sp<IAudioFlinger> gAudioFlinger;
static audio_error_callback gAudioErrorCallback;