110 size_t max_items,
size_t item_size);
281 void* item,
int msec_timeout);
307 void* item,
int msec_timeout);
Provides constants for the abstract FIFO implementation (guac_fifo).
Provides type definitions for the abstract FIFO implementation (guac_fifo).
void guac_fifo_init(guac_fifo *fifo, void *items, size_t max_items, size_t item_size)
Initializes the given guac_fifo such that it may be safely included in shared memory and accessed by ...
int guac_fifo_timed_dequeue(guac_fifo *fifo, void *item, int msec_timeout)
Removes the oldest (first) item from the FIFO, storing a copy of that item within the provided buffer...
void guac_fifo_lock(guac_fifo *fifo)
Acquires exclusive access to this guac_fifo.
int guac_fifo_enqueue_and_lock(guac_fifo *fifo, const void *item)
Atomically adds a copy of the given item to the end of the given FIFO, signals any waiting threads th...
int guac_fifo_timed_dequeue_and_lock(guac_fifo *fifo, void *item, int msec_timeout)
Atomically removes the oldest (first) item from the FIFO, storing a copy of that item within the prov...
void guac_fifo_invalidate(guac_fifo *fifo)
Marks the given FIFO as invalid, preventing any further additions or removals from the FIFO.
void guac_fifo_unlock(guac_fifo *fifo)
Relinquishes exclusive access to this guac_fifo.
void guac_fifo_destroy(guac_fifo *fifo)
Releases all underlying resources used by the given guac_fifo, such as pthread mutexes and conditions...
int guac_fifo_dequeue_and_lock(guac_fifo *fifo, void *item)
Atomically removes the oldest (first) item from the FIFO, storing a copy of that item within the prov...
int guac_fifo_enqueue(guac_fifo *fifo, const void *item)
Adds a copy of the given item to the end of the given FIFO, and signals any waiting threads that the ...
int guac_fifo_is_valid(guac_fifo *fifo)
Returns whether the given FIFO is still valid.
int guac_fifo_dequeue(guac_fifo *fifo, void *item)
Removes the oldest (first) item from the FIFO, storing a copy of that item within the provided buffer...
Generic base structure for a FIFO of arbitrary events.
Definition fifo.h:45
size_t item_count
The current number of items stored within this FIFO.
Definition fifo.h:76
guac_flag state
The current state of this FIFO.
Definition fifo.h:53
size_t max_items
The maximum number of items that may be stored in this FIFO.
Definition fifo.h:58
size_t head
The index of the first item within this FIFO.
Definition fifo.h:71
size_t item_size
The size of each individual item, in bytes.
Definition fifo.h:64
ssize_t items_offset
The offset of the first byte of the implementation-specific array of items within this FIFO,...
Definition fifo.h:83
Generic integer flag intended for signalling of arbitrary events between processes.
Definition flag.h:27