Win32: fix recursive locking imbalance
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 7 Sep 2008 18:33:39 +0000 (21:33 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 7 Sep 2008 18:33:39 +0000 (21:33 +0300)
src/misc/threads.c

index 13ff3cc..795d978 100644 (file)
@@ -376,8 +376,11 @@ void vlc_mutex_unlock (vlc_mutex_t *p_mutex)
 #elif defined( WIN32 )
     if (p_mutex->recursive)
     {
-        if (--p_mutex->recursion != 0)
+        if (p_mutex->recursion != 0)
+        {
+            p_mutex->recursion--;
             return; /* We still own this mutex */
+        }
 
         /* We release the mutex */
         DWORD self = GetCurrentThreadId ();