28 #include <sys/types.h> 110 size_t max_items,
size_t item_size);
281 void* item,
int msec_timeout);
307 void* item,
int msec_timeout);
void guac_fifo_unlock(guac_fifo *fifo)
Relinquishes 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...
Provides constants for the abstract FIFO implementation (guac_fifo).
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...
ssize_t items_offset
The offset of the first byte of the implementation-specific array of items within this FIFO...
Definition: fifo.h:83
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...
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...
void guac_fifo_invalidate(guac_fifo *fifo)
Marks the given FIFO as invalid, preventing any further additions or removals from the FIFO...
size_t head
The index of the first item within this FIFO.
Definition: fifo.h:71
int guac_fifo_is_valid(guac_fifo *fifo)
Returns whether the given FIFO is still valid.
Generic integer flag intended for signalling of arbitrary events between processes.
Definition: flag.h:27
size_t max_items
The maximum number of items that may be stored in this FIFO.
Definition: fifo.h:58
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_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 ...
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
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...
Generic base structure for a FIFO of arbitrary events.
Definition: fifo.h:45
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 ...
void guac_fifo_lock(guac_fifo *fifo)
Acquires exclusive access to this guac_fifo.
size_t item_size
The size of each individual item, in bytes.
Definition: fifo.h:64
Provides type definitions for the abstract FIFO implementation (guac_fifo).