Fork: Fix deadlock in AudioManagerAndroid.init
SettingsObserverThread is started by UI thread, and UI thread waits for
it to start by waiting on a lock. However the thread is started when the
lock is not held, meaning it could start and signal the lock, all before
UI thread even enters the lock synchronized code, thus causing the wait
to simply deadlock.
Fix by moving start to lock synchronized code.
Note that Chrome m33 is going to ship with this bug unfixed. Chromium
trunk already has this fixed. But it was only inadvertently fixed as
part of a larger refactor, so not appropriate to cherry-pick.
1 file changed