Lines Matching defs:queue
30 * A synchronized FIFO queue for inter-thread producer-consumer semantics.
31 * This queue will handle multiple writers and readers simultaneously.
34 * slp_new_queue: create a new queue
35 * slp_enqueue: place a message at the end of the queue
36 * slp_enqueue_at_head: place a message the the start of the queue
37 * slp_dequeue: remove and return the next message on the queue
39 * slp_dequeue_timed: remove and return the next message on the queue
41 * slp_flush_queue: flushes and frees all messages on a queue
42 * slp_destroy_queue: frees an empty queue.
60 struct queue {
69 * Creates, initializes, and returns a new queue.
74 * be enabled for the new queue.
79 struct queue *q;
98 /* create the queue */
114 * Adds msg to the tail of queue q.
120 struct queue *q = qa;
130 if (q->head != NULL) { /* queue is not emptry */
133 } else { /* queue is empty */
144 * Inserts a message at the head of the queue. This is useful for inserting
149 struct queue *q = qa;
171 static void *dequeue_nolock(struct queue *q) {
178 if (!qe->next) /* last one in queue */
188 * Returns the first message waiting or arriving in the queue, or if no
196 struct queue *q = qa;
228 * Removes the first message from the queue and returns it.
236 * Flushes the queue, using the caller-specified free function to
237 * free each message in the queue.
241 struct queue *q = qa;
250 * Frees a queue.
251 * The queue must be empty before it can be destroyed; slp_flush_queue
252 * can be used to empty a queue.
255 struct queue *q = qa;