summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Effects.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-09-25 12:25:29 -0700
committerEric Laurent <elaurent@google.com>2013-09-25 12:44:00 -0700
commiteb3c337a3d6c74ec857dfc8be7eeafe634614bcd (patch)
tree7ade01c31e70ffeadf88fc60b2144faa47f9c49f /services/audioflinger/Effects.h
parentd2ac3144e201398340cc5b9bb36e5efe39edd9eb (diff)
downloadframeworks_av-eb3c337a3d6c74ec857dfc8be7eeafe634614bcd.zip
frameworks_av-eb3c337a3d6c74ec857dfc8be7eeafe634614bcd.tar.gz
frameworks_av-eb3c337a3d6c74ec857dfc8be7eeafe634614bcd.tar.bz2
fix deadlock in audioflinger::createEffect()
commit 5baf2af5 introduced a regression by calling getOutputForEffect() with AudioFLinger main mutex locked. The locking order must always be AudioPolicyService mutex then AudioFlinger then ThreadBase mutex. Bug: 10916796. Change-Id: Ide34a2d84dbb06dbb35abd0640d91b01b0ac4d40
Diffstat (limited to 'services/audioflinger/Effects.h')
-rw-r--r--services/audioflinger/Effects.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/audioflinger/Effects.h b/services/audioflinger/Effects.h
index c35cff0..b717857 100644
--- a/services/audioflinger/Effects.h
+++ b/services/audioflinger/Effects.h
@@ -25,6 +25,10 @@
// state changes or resource modifications. Always respect the following order
// if multiple mutexes must be acquired to avoid cross deadlock:
// AudioFlinger -> ThreadBase -> EffectChain -> EffectModule
+// In addition, methods that lock the AudioPolicyService mutex (getOutputForEffect(),
+// startOutput()...) should never be called with AudioFlinger or Threadbase mutex locked
+// to avoid cross deadlock with other clients calling AudioPolicyService methods that in turn
+// call AudioFlinger thus locking the same mutexes in the reverse order.
// The EffectModule class is a wrapper object controlling the effect engine implementation
// in the effect library. It prevents concurrent calls to process() and command() functions