[Scummvm-git-logs] scummvm master -> 379e3b80daea93a375a752dd582aa42830054e18

wjp wjp at usecode.org
Sat Oct 8 22:35:03 CEST 2016


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:
379e3b80da SCI: Release SCI music mutex earlier in reconstructPlayList


Commit: 379e3b80daea93a375a752dd582aa42830054e18
    https://github.com/scummvm/scummvm/commit/379e3b80daea93a375a752dd582aa42830054e18
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2016-10-08T22:32:13+02:00

Commit Message:
SCI: Release SCI music mutex earlier in reconstructPlayList

This avoids a deadlock where the main thread (via reconstructPlayList)
tries to acquire the mixer lock (in soundPlay) while holding the SCI
music lock, and the audio thread is holding the mixer lock and tries to
acquire the SCI music lock (in miditimerCallback). Bug #6691.

Changed paths:
    engines/sci/engine/savegame.cpp



diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 20889f2..f01e2a6 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -632,13 +632,16 @@ void SoundCommandParser::syncPlayList(Common::Serializer &s) {
 }
 
 void SoundCommandParser::reconstructPlayList() {
-	Common::StackLock lock(_music->_mutex);
+	_music->_mutex.lock();
 
 	// We store all songs here because starting songs may re-shuffle their order
 	MusicList songs;
 	for (MusicList::iterator i = _music->getPlayListStart(); i != _music->getPlayListEnd(); ++i)
 		songs.push_back(*i);
 
+	// Done with main playlist, so release lock
+	_music->_mutex.unlock();
+
 	for (MusicList::iterator i = songs.begin(); i != songs.end(); ++i) {
 		initSoundResource(*i);
 





More information about the Scummvm-git-logs mailing list