From f6778fd0c72ab54328f0e9f5ecf0017b73e99dd8 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Tue, 18 Nov 2014 17:26:58 -0800 Subject: 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 --- include/media/AudioSystem.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/media/AudioSystem.h') 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 gAudioFlinger; static audio_error_callback gAudioErrorCallback; -- cgit v1.1