[vlc-devel] commit: Win32: watch for bugs in vlc_cond_(timed)?wait ( Rémi Denis-Courmont )

git version control git at videolan.org
Mon Apr 27 22:35:10 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Apr 27 23:33:25 2009 +0300| [3ee8acdb1392cdc070859ad4332203eb8148c4e7] | committer: Rémi Denis-Courmont 

Win32: watch for bugs in vlc_cond_(timed)?wait

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3ee8acdb1392cdc070859ad4332203eb8148c4e7
---

 src/misc/threads.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/misc/threads.c b/src/misc/threads.c
index 46bf624..b4da0f6 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -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;




More information about the vlc-devel mailing list