Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Android: Fix race condition in displayAlertMsg
It was possible for sAlertMessageLock.notify() to be called before sAlertMessageLock.wait(), causing Dolphin to deadlock. In particular, this was guaranteed to happen if displayAlertMsg was called from the UI thread while the emulation activity is being destroyed, because runOnUiThread runs the passed-in anonymous function immediately when called from the UI thread. By replacing Object.wait/Object.notify with Semaphore.acquire/ Semaphore.release, it no longer matters what order the methods are called in.
- Loading branch information