[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


cma_lib_queue_requeue

Inserts an element at the front of an atomic queue.

Syntax

cma_lib_queue_requeue (queue, element)
 


Argument Data Type Access

queue opaque cma_lib_t_queue read element opaque cma_t_address read


C Binding

void
cma_lib_queue_requeue (
cma_lib_t_queue *queue,
cma_lib_t_address element);

Arguments

queue
Handle of the queue to which the element is inserted.
element
Address of the queue element inserted.

Description

This routine inserts an element at the front of a queue. If the queue is full, the calling thread is blocked until an element is removed from the queue. When the element is dequeued the calling thread resumes, the new element is inserted, and this routine returns.

Call cma_lib_queue_try_requeue to insert an element at the front of a queue and return a status code (instead of blocking) if the queue is full.

This routine allows you to replace an element that was erroneously removed from a queue. For example, a queue might hold information of various types. In that case a thread can remove the oldest (first) element of the queue, check its type, and requeue the element if it is not the desired type (rather than enqueuing it, which would place the element at the end of the queue).

Exceptions

cma_e_existence
cma_e_use_error



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]