]> git.sesse.net Git - vlc/commitdiff
Win32: watch for bugs in vlc_cond_(timed)?wait
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 27 Apr 2009 20:33:25 +0000 (23:33 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 27 Apr 2009 20:33:25 +0000 (23:33 +0300)
src/misc/threads.c

index 46bf624e35fc5056f0a623ae3eab15020c44499e..b4da0f65765623356c16fba362ade4f84789caaa 100644 (file)
@@ -596,6 +596,8 @@ void vlc_cond_wait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex)
     }
     while (result == WAIT_IO_COMPLETION);
 
+    assert (result != WAIT_ABANDONED); /* another thread failed to cleanup! */
+    assert (result != WAIT_FAILED);
     ResetEvent (*p_condvar);
 
 #endif
@@ -652,6 +654,8 @@ int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
     }
     while (result == WAIT_IO_COMPLETION);
 
+    assert (result != WAIT_ABANDONED);
+    assert (result != WAIT_FAILED);
     ResetEvent (*p_condvar);
 
     return (result == WAIT_OBJECT_0) ? 0 : ETIMEDOUT;