shithub: choc

Download patch

ref: 1398c8aed38b0d42e7081410ae1710858d335f7e
parent: 5f2cfb50d1632b015817f442b507b36c83301332
author: Simon Howard <[email protected]>
date: Sat Feb 27 12:48:25 EST 2010

Fix race condition with condition variable freed before it is signaled.

Subversion-branch: /branches/opl-branch
Subversion-revision: 1873

--- a/opl/opl.c
+++ b/opl/opl.c
@@ -415,9 +415,10 @@
 
     SDL_LockMutex(delay_data->mutex);
     delay_data->finished = 1;
-    SDL_UnlockMutex(delay_data->mutex);
 
     SDL_CondSignal(delay_data->cond);
+
+    SDL_UnlockMutex(delay_data->mutex);
 }
 
 void OPL_Delay(unsigned int ms)