[Scummvm-cvs-logs] SF.net SVN: scummvm:[53820] scummvm/branches/branch-1-2-0/engines/sci/sound /music.cpp
wjpalenstijn at users.sourceforge.net
wjpalenstijn at users.sourceforge.net
Mon Oct 25 13:19:45 CEST 2010
Revision: 53820
http://scummvm.svn.sourceforge.net/scummvm/?rev=53820&view=rev
Author: wjpalenstijn
Date: 2010-10-25 11:19:44 +0000 (Mon, 25 Oct 2010)
Log Message:
-----------
SCI: Backport r53613: fixing possible deadlock inside clearPlaylist
Modified Paths:
--------------
scummvm/branches/branch-1-2-0/engines/sci/sound/music.cpp
Modified: scummvm/branches/branch-1-2-0/engines/sci/sound/music.cpp
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sci/sound/music.cpp 2010-10-25 11:13:54 UTC (rev 53819)
+++ scummvm/branches/branch-1-2-0/engines/sci/sound/music.cpp 2010-10-25 11:19:44 UTC (rev 53820)
@@ -145,8 +145,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