int bq_push(bounded_queue_t *q, void *item)
Add an entry to the queue. Handles not_full, blocks while full.
Definition bounded_queue.c:42
void bq_destroy(bounded_queue_t *q)
Destroy the bounded queue and free resources.
Definition bounded_queue.c:32
void bq_shutdown(bounded_queue_t *q)
Handle clean shutdown when working queue is done. Responsible for handling all waiting workers on dea...
Definition bounded_queue.c:87
bounded_queue_t * bq_create(size_t capacity)
Create a bounded queue with a fixed capacity.
Definition bounded_queue.c:4
void * bq_pop(bounded_queue_t *q)
Pop an entry from the queue. Handles not_empty signal, blocks if empty.
Definition bounded_queue.c:66
A Circular ring queue, fixed size, to create a pool of events to be parsed.
Definition bounded_queue.h:12
pthread_mutex_t mu_lock
Definition bounded_queue.h:19
size_t count
Definition bounded_queue.h:17
pthread_cond_t not_full
Definition bounded_queue.h:21
pthread_cond_t not_empty
Definition bounded_queue.h:20
size_t capacity
Definition bounded_queue.h:14
void ** buf
Definition bounded_queue.h:13
size_t tail
Definition bounded_queue.h:16
size_t head
Definition bounded_queue.h:15
int done
Definition bounded_queue.h:23