Win32: vlc_mutex_lock is *not* a cancellation point
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 15 Feb 2010 20:13:47 +0000 (22:13 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 15 Feb 2010 20:13:47 +0000 (22:13 +0200)
src/win32/thread.c

index 08de712..7c0909d 100644 (file)
@@ -191,6 +191,7 @@ void vlc_mutex_lock (vlc_mutex_t *p_mutex)
 {
     if (!p_mutex->dynamic)
     {   /* static mutexes */
+        int canc = vlc_savecancel ();
         assert (p_mutex != &super_mutex); /* this one cannot be static */
 
         vlc_mutex_lock (&super_mutex);
@@ -202,6 +203,7 @@ void vlc_mutex_lock (vlc_mutex_t *p_mutex)
         }
         p_mutex->locked = true;
         vlc_mutex_unlock (&super_mutex);
+        vlc_restorecancel (canc);
         return;
     }