[Scummvm-cvs-logs] SF.net SVN: scummvm:[53613] scummvm/trunk/engines/sci/sound/music.cpp

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Tue Oct 19 16:53:40 CEST 2010


Revision: 53613
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53613&view=rev
Author:   m_kiewitz
Date:     2010-10-19 14:53:39 +0000 (Tue, 19 Oct 2010)

Log Message:
-----------
SCI: fixing possible deadlock inside clearPlaylist

thx to ajax16384

Modified Paths:
--------------
    scummvm/trunk/engines/sci/sound/music.cpp

Modified: scummvm/trunk/engines/sci/sound/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/music.cpp	2010-10-19 13:26:08 UTC (rev 53612)
+++ scummvm/trunk/engines/sci/sound/music.cpp	2010-10-19 14:53:39 UTC (rev 53613)
@@ -158,8 +158,10 @@
 }
 
 void SciMusic::clearPlayList() {
-	Common::StackLock lock(_mutex);
-
+	// we must NOT lock our mutex here. Playlist is modified inside soundKill() which will lock the mutex
+	//  during deletion. If we lock it here, a deadlock may occur within soundStop() because that one
+	//  calls the mixer, which will also lock the mixer mutex and if the mixer thread is active during
+	//  that time, we will get a deadlock.
 	while (!_playList.empty()) {
 		soundStop(_playList[0]);
 		soundKill(_playList[0]);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list