Commit 2a8b955a authored by Thomas Guillem's avatar Thomas Guillem

block: add vlc_fifo_TimedWaitCond

parent 8c4fff2f
......@@ -326,6 +326,7 @@ VLC_API void vlc_fifo_Unlock(vlc_fifo_t *);
VLC_API void vlc_fifo_Signal(vlc_fifo_t *);
VLC_API void vlc_fifo_Wait(vlc_fifo_t *);
VLC_API void vlc_fifo_WaitCond(vlc_fifo_t *, vlc_cond_t *);
int vlc_fifo_TimedWaitCond(vlc_fifo_t *, vlc_cond_t *, mtime_t);
VLC_API void vlc_fifo_QueueUnlocked(vlc_fifo_t *, block_t *);
VLC_API block_t *vlc_fifo_DequeueUnlocked(vlc_fifo_t *) VLC_USED;
VLC_API block_t *vlc_fifo_DequeueAllUnlocked(vlc_fifo_t *) VLC_USED;
......
......@@ -110,6 +110,15 @@ void vlc_fifo_WaitCond(vlc_fifo_t *fifo, vlc_cond_t *condvar)
vlc_cond_wait(condvar, &fifo->lock);
}
/**
* Atomically unlocks the FIFO and waits until one thread signals the FIFO up
* to a certain date, then locks the FIFO again. See vlc_fifo_Wait().
*/
int vlc_fifo_TimedWaitCond(vlc_fifo_t *fifo, vlc_cond_t *condvar, mtime_t deadline)
{
return vlc_cond_timedwait(condvar, &fifo->lock, deadline);
}
/**
* Checks how many blocks are queued in a locked FIFO.
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment