APIs for queue operations on the host.
|
#define | TIVX_QUEUE_FLAG_BLOCK_ON_PUT (0x00000001u) |
| Flag to indicate queue should block 'put' operation until free space is available for 'put' to succeed.
|
|
#define | TIVX_QUEUE_FLAG_BLOCK_ON_GET (0x00000002u) |
| Flag to indicate queue should block 'get' operation until new element is available in queue to extract.
|
|
◆ tivxQueueCreate()
vx_status tivxQueueCreate |
( |
tivx_queue * |
queue, |
|
|
uint32_t |
max_elements, |
|
|
uintptr_t * |
queue_memory, |
|
|
uint32_t |
flags |
|
) |
| |
Create a queue.
- Parameters
-
queue | [out] Pointer to queue object |
max_elements | [in] Max elements in a queue |
queue_memory | [in] Pointer to queue memory, queue can only contain elements of size 32bits |
flags | [in] Flags to use during queue creation, see TIVX_QUEUE_FLAG_xxx |
- Returns
- VX_SUCCESS on success
◆ tivxQueueDelete()
Delete a queue.
- Parameters
-
queue | [in] Pointer to queue object |
- Returns
- VX_SUCCESS on success
◆ tivxQueuePut()
Add a element into the queue.
- Parameters
-
queue | [in] Pointer to queue object |
data | [in] element to add |
timeout | [in] Amount of time to wait, TIVX_QUEUE_FLAG_BLOCK_ON_PUT msut be set during create, else function does not wait and returns error if queue is full |
- Returns
- VX_SUCCESS on success
◆ tivxQueueGet()
Extract a element from the queue.
- Parameters
-
queue | [in] Pointer to queue object |
data | [out] element that is extracted |
timeout | [in] Amount of time to wait, TIVX_QUEUE_FLAG_BLOCK_ON_GET msut be set during create, else function does not wait and returns error if queue is empty |
- Returns
- VX_SUCCESS on success
◆ tivxQueuePeek()
Peek an element from the queue but dont extract it.
- Parameters
-
queue | [in] Pointer to queue object |
data | [out] element that is 'peeked' |
- Returns
- VX_SUCCESS on success
◆ tivxQueueIsEmpty()
Check if queue is empty.
- Parameters
-
queue | [in] Pointer to queue object |
- Returns
- vx_true_e if queue is empty, else vx_false_e