[Scummvm-git-logs] scummvm master -> 1738a2fac7ea257f31be828b5a9c3a719c19ef7a

bluegr noreply at scummvm.org
Tue Nov 28 19:21:47 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1738a2fac7 TINSEL: Fix DW2 deadlock in PCMMusicPlayer when loading scene


Commit: 1738a2fac7ea257f31be828b5a9c3a719c19ef7a
    https://github.com/scummvm/scummvm/commit/1738a2fac7ea257f31be828b5a9c3a719c19ef7a
Author: PushmePullyu (127053144+PushmePullyu at users.noreply.github.com)
Date: 2023-11-28T21:21:43+02:00

Commit Message:
TINSEL: Fix DW2 deadlock in PCMMusicPlayer when loading scene

Preemptively acquire mixer lock to match locking order of audio thread.

Fixes #13953

Changed paths:
    engines/tinsel/music.cpp


diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp
index 7bc00726c43..aa2e5593139 100644
--- a/engines/tinsel/music.cpp
+++ b/engines/tinsel/music.cpp
@@ -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();




More information about the Scummvm-git-logs mailing list