mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-02 08:19:19 +00:00
SCI: fixing possible deadlock inside clearPlaylist
thx to ajax16384 svn-id: r53613
This commit is contained in:
parent
6a1e874447
commit
f8c7243938
@ -158,8 +158,10 @@ void SciMusic::sendMidiCommandsFromQueue() {
|
||||
}
|
||||
|
||||
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]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user