summaryrefslogtreecommitdiff
path: root/tools/aidl/generate_java.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2009-07-31 06:29:13 -0700
committerEric Laurent <elaurent@google.com>2009-07-31 06:29:13 -0700
commitfd8c0e1ff8ef781ba169c0164458ec1ce95ee35c (patch)
tree7a0fe8f26358c736db5ff27f9675c24a9ce8555c /tools/aidl/generate_java.cpp
parent3e584428deb098484cc881192dd221c81f707764 (diff)
Fix issue 2025872: Deadlock in SoundPool.stop
There were 2 problems in SoundPool: 1 If not using the shared memory buffer mode, there was a problem when a sound channel was stolen. The new channel could sometimes not be added to the restart list if the AudioTrack callback thread was stopped before the underrun callback was called. The SoundChannel::play() method is modified so that SoundPool::done() is called immediately after stopping the channel. There is a possibility that done() is called a second time by the callback; in this case it will be added 2 times to the restart list but the second start request will be ignored as the first one will have reset the next chennel ID when processed. 2 There was a deadlock on SoundPool::mLock if SoundPool::stop() was called while a channel restart was pending: SoundPool::stop() lock mLock -> SoundChannel::stop() -> SoundPool::done() -> SoundPool::addToRestartList() -> try to lock mLock == deadlock A second mutex mRestartLock is added to protect the restart list mRestart. mLock is still used to protect mChannels list but mRestart is now used to protect access to mRestart by restart thread and client thread.
Diffstat (limited to 'tools/aidl/generate_java.cpp')
0 files changed, 0 insertions, 0 deletions