]> git.sesse.net Git - vlc/commitdiff
* src/misc/block.c: win32 race condition fix.
authorGildas Bazin <gbazin@videolan.org>
Mon, 5 Jul 2004 13:04:11 +0000 (13:04 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 5 Jul 2004 13:04:11 +0000 (13:04 +0000)
src/misc/block.c

index d6c56bf943ab4a1bb77872e7abffa7b160bb01cf..9d07f63fa4d96d72734a0b7f5780093735aa862f 100644 (file)
@@ -408,7 +408,10 @@ block_t *block_FifoGet( block_fifo_t *p_fifo )
 
     vlc_mutex_lock( &p_fifo->lock );
 
-    if( p_fifo->p_first == NULL )
+    /* We do a while here because there is a race condition in the
+     * win32 implementation of vlc_cond_wait() (We can't be sure the fifo
+     * hasn't been emptied again since we were signaled). */
+    while( p_fifo->p_first == NULL )
     {
         vlc_cond_wait( &p_fifo->wait, &p_fifo->lock );
     }