tizqueue

group tizqueue

Thread-safe FIFO queue.

Typedefs

typedef struct tiz_queue tiz_queue_t

Queue opaque structure.

Functions

OMX_ERRORTYPE tiz_queue_init(tiz_queue_ptr_t * app_q, OMX_S32 a_capacity)

Initialize a new empty queue.

Return
OMX_ErrorNone if success, OMX_ErrorInsufficientResources otherwise.
Parameters
  • a_capacity: Maximum number of items that can be send into the queue.

void tiz_queue_destroy(tiz_queue_t * ap_q)

Destroy a queue. If ap_q is NULL, or the queue has already been detroyed before, no operation is performed.

OMX_ERRORTYPE tiz_queue_send(tiz_queue_t * ap_q, OMX_PTR ap_data)

Add an item onto the end of the queue. If the queue is full, it blocks until a space becomes available.

OMX_ERRORTYPE tiz_queue_receive(tiz_queue_t * ap_q, OMX_PTR * app_data)

Retrieve an item from the head of the queue. If the queue is empty, it blocks until an item becomes available.

OMX_ERRORTYPE tiz_queue_timed_receive(tiz_queue_t * ap_q, OMX_PTR * app_data, OMX_U32 a_millis)

Retrieve an item from the head of the queue. If the queue is empty, it waits for up to a_millis milliseconds or until an item becomes available.

OMX_S32 tiz_queue_capacity(tiz_queue_t * ap_q)

Retrieve the maximum number of items that can be stored in the queue.

OMX_S32 tiz_queue_length(tiz_queue_t * ap_q)

Retrieve the number of items currently stored in the queue.