mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-22 20:21:06 +00:00
TINSEL: Fix DW2 deadlock in PCMMusicPlayer when loading scene
Preemptively acquire mixer lock to match locking order of audio thread. Fixes #13953
This commit is contained in:
parent
b2cb32202e
commit
1738a2fac7
@ -839,6 +839,11 @@ void PCMMusicPlayer::restoreThatTune(void *voidPtr) {
|
||||
void PCMMusicPlayer::setMusicSceneDetails(SCNHANDLE hScript,
|
||||
SCNHANDLE hSegment, const char *fileName) {
|
||||
|
||||
// A call to setVol(uint8) later in this method will lock the mixer.
|
||||
// To match the locking order of the audio thread and prevent a deadlock,
|
||||
// we preemptively lock it here first.
|
||||
// See bug #13953
|
||||
Common::StackLock mixerLock(_vm->_mixer->mutex());
|
||||
Common::StackLock lock(_mutex);
|
||||
|
||||
stop();
|
||||
|
Loading…
x
Reference in New Issue
Block a user