VLC 4.0.0-dev
|
Modules | |
Queue internals | |
Low-level queue functions. | |
Killable queues | |
Thread-safe queues with an end flag. | |
Files | |
file | vlc_queue.h |
Data Structures | |
struct | vlc_queue |
Thread-safe queue (a.k.a. More... | |
Typedefs | |
typedef struct vlc_queue | vlc_queue_t |
Thread-safe queue (a.k.a. More... | |
Functions | |
void | vlc_queue_Init (vlc_queue_t *queue, ptrdiff_t next_offset) |
Initializes a queue. More... | |
void | vlc_queue_Enqueue (vlc_queue_t *, void *entry) |
Queues an entry. More... | |
void * | vlc_queue_Dequeue (vlc_queue_t *queue) |
Dequeues the oldest entry. More... | |
void * | vlc_queue_DequeueAll (vlc_queue_t *) |
Dequeues all entries. More... | |
typedef struct vlc_queue vlc_queue_t |
Thread-safe queue (a.k.a.
FIFO).
void * vlc_queue_Dequeue | ( | vlc_queue_t * | queue | ) |
Dequeues the oldest entry.
This function dequeues an entry from a thread-safe queue. If the queue is empty, it will wait until at least one entry is available.
queue | queue object to dequeue an entry from |
References vlc_queue_DequeueUnlocked(), vlc_queue_IsEmpty(), vlc_queue_Lock(), vlc_queue_Unlock(), vlc_queue_Wait(), and vlc_testcancel().
void * vlc_queue_DequeueAll | ( | vlc_queue_t * | q | ) |
Dequeues all entries.
This is equivalent to calling vlc_queue_Dequeue() repeatedly until the queue is emptied. However this function is much faster than that, as it does not need to update the linked-list pointers.
References vlc_queue_DequeueAllUnlocked(), vlc_queue_Lock(), and vlc_queue_Unlock().
void vlc_queue_Enqueue | ( | vlc_queue_t * | q, |
void * | entry | ||
) |
Queues an entry.
This function enqueues an entry, or rather a linked-list of entries, in a thread-safe queue.
entry | list of entries (if NULL, this function has no effects) |
References vlc_queue_EnqueueUnlocked(), vlc_queue_Lock(), and vlc_queue_Unlock().
void vlc_queue_Init | ( | vlc_queue_t * | queue, |
ptrdiff_t | next_offset | ||
) |
Initializes a queue.
queue | storage space for the queue |
next_offset | offset of the pointer to the next element within a queue entry (as per offsetof() ) |
References vlc_queue::first, vlc_queue::lastp, vlc_queue::lock, vlc_queue::next_offset, vlc_cond_init(), vlc_mutex_init(), and vlc_queue::wait.
Referenced by vlc_fifo_New(), and vlc_stream_fifo_New().