Manually reset the events
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 7 Sep 2008 17:53:53 +0000 (20:53 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 7 Sep 2008 17:53:53 +0000 (20:53 +0300)
src/misc/threads.c

index bcfcd01..13ff3cc 100644 (file)
@@ -530,6 +530,7 @@ void vlc_cond_wait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex)
         LeaveCriticalSection (&p_mutex->mutex);
         result = WaitForSingleObjectEx (*p_condvar, INFINITE, TRUE);
         EnterCriticalSection (&p_mutex->mutex);
+        ResetEvent (*p_condvar);
     }
     while (result == WAIT_IO_COMPLETION);
 
@@ -574,6 +575,7 @@ int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
         LeaveCriticalSection (&p_mutex->mutex);
         result = WaitForSingleObjectEx (*p_condvar, delay, TRUE);
         EnterCriticalSection (&p_mutex->mutex);
+        ResetEvent (*p_condvar);
     }
     while (result == WAIT_IO_COMPLETION);