parrotcode: Thread-safe queues | |
Contents | C |
src/tsq.c - Thread-safe queues
PARROT_CAN_RETURN_NULL QUEUE_ENTRY *pop_entry(NOTNULL(QUEUE *queue))
PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT QUEUE_ENTRY *peek_entry(NOTNULL(QUEUE *queue))
pop_entry()
will check again and return NULL
if the queue is empty.PARROT_CAN_RETURN_NULL QUEUE_ENTRY *nosync_pop_entry(NOTNULL(QUEUE *queue))
PARROT_CAN_RETURN_NULL QUEUE_ENTRY *wait_for_entry(NOTNULL(QUEUE *queue))
void push_entry(NOTNULL(QUEUE *queue), NOTNULL(QUEUE_ENTRY *entry))
entry
onto the tail of the queue.void unshift_entry(NOTNULL(QUEUE *queue), NOTNULL(QUEUE_ENTRY *entry))
entry
into the head of the queue.void nosync_insert_entry(NOTNULL(QUEUE *queue), NOTNULL(QUEUE_ENTRY *entry))
abstime
.
The caller has to hold the queue mutex.void insert_entry(NOTNULL(QUEUE *queue), NOTNULL(QUEUE_ENTRY *entry))
entry
.void queue_lock(NOTNULL(QUEUE *queue))
void queue_unlock(NOTNULL(QUEUE *queue))
void queue_broadcast(NOTNULL(QUEUE *queue))
void queue_signal(NOTNULL(QUEUE *queue))
void queue_wait(NOTNULL(QUEUE *queue))
void queue_timedwait(NOTNULL(QUEUE *queue), NOTNULL(struct timespec *abs_time))
abs_time
seconds (?).PARROT_CAN_RETURN_NULL PARROT_MALLOC QUEUE *queue_init(UINTVAL prio)
prio
as the queue's priority.void queue_destroy(NOTNULL(QUEUE *queue))
include/parrot/tsq.h.
|