fix possible lock order problem

This commit is contained in:
Glenn Maynard
2006-12-23 10:27:21 +00:00
parent 5dac62ea7d
commit 80059b308b
+5 -1
View File
@@ -367,10 +367,14 @@ void RageSound::SoundIsFinishedPlaying()
{
if( !m_bPlaying )
return;
m_Mutex.Lock();
/* Lock the mutex after calling UnregisterPlayingSound. We must not make driver
* calls with our mutex locked (driver mutex < sound mutex). Nobody else will
* see our sound as not playing until we set playing to false. */
m_iStoppedSourceFrame = (int) GetPositionSecondsInternal();
m_Mutex.Lock();
// LOG->Trace("set playing false for %p (SoundIsFinishedPlaying) (%s)", this, this->GetLoadedFilePath().c_str());
m_bPlaying = false;