Go to the source code of this file.
Data Structures | |
struct | as_queue_mt |
Macros | |
#define | AS_QUEUE_FOREVER -1 |
#define | as_queue_mt_inita(__q, __item_size, __capacity) |
#define | AS_QUEUE_NOWAIT 0 |
Functions | |
AS_EXTERN as_queue_mt * | as_queue_mt_create (uint32_t item_size, uint32_t capacity) |
static void | as_queue_mt_destroy (as_queue_mt *queue) |
static bool | as_queue_mt_empty (as_queue_mt *queue) |
AS_EXTERN bool | as_queue_mt_init (as_queue_mt *queue, uint32_t item_size, uint32_t capacity) |
AS_EXTERN bool | as_queue_mt_pop (as_queue_mt *queue, void *ptr, int wait_ms) |
AS_EXTERN bool | as_queue_mt_pop_tail (as_queue_mt *queue, void *ptr, int wait_ms) |
static bool | as_queue_mt_push (as_queue_mt *queue, const void *ptr) |
static bool | as_queue_mt_push_head (as_queue_mt *queue, const void *ptr) |
static bool | as_queue_mt_push_head_limit (as_queue_mt *queue, const void *ptr) |
static bool | as_queue_mt_push_limit (as_queue_mt *queue, const void *ptr) |
static uint32_t | as_queue_mt_size (as_queue_mt *queue) |
#define AS_QUEUE_FOREVER -1 |
Definition at line 56 of file as_queue_mt.h.
#define as_queue_mt_inita | ( | __q, | |
__item_size, | |||
__capacity ) |
Initialize a stack allocated as_queue_mt, with item storage on the stack. as_queue_mt_inita() will transfer stack memory to the heap if a resize is required.
Definition at line 64 of file as_queue_mt.h.
#define AS_QUEUE_NOWAIT 0 |
Definition at line 57 of file as_queue_mt.h.
AS_EXTERN as_queue_mt * as_queue_mt_create | ( | uint32_t | item_size, |
uint32_t | capacity ) |
Create a heap allocated as_queue, with item storage on the heap.
|
inlinestatic |
Release queue memory.
Definition at line 89 of file as_queue_mt.h.
References as_queue_destroy(), as_queue_mt::cond, as_queue_mt::lock, and as_queue_mt::queue.
|
inlinestatic |
Is queue empty?
Definition at line 112 of file as_queue_mt.h.
References as_queue_empty(), as_queue_mt::lock, and as_queue_mt::queue.
AS_EXTERN bool as_queue_mt_init | ( | as_queue_mt * | queue, |
uint32_t | item_size, | ||
uint32_t | capacity ) |
Initialize a stack allocated as_queue, with item storage on the heap.
AS_EXTERN bool as_queue_mt_pop | ( | as_queue_mt * | queue, |
void * | ptr, | ||
int | wait_ms ) |
Pop from the head of the queue.
If the queue is empty, wait_ms is the maximum time in milliseconds to wait for an available entry. If wait_ms is AS_QUEUE_FOREVER (-1), the wait time will be forever. If wait_ms is AS_QUEUE_NOWAIT (0), the function will not wait.
The return value is true if an entry was successfully retrieved.
AS_EXTERN bool as_queue_mt_pop_tail | ( | as_queue_mt * | queue, |
void * | ptr, | ||
int | wait_ms ) |
Pop from the tail of the queue.
If the queue is empty, wait_ms is the maximum time in milliseconds to wait for an available entry. If wait_ms is AS_QUEUE_FOREVER (-1), the wait time will be forever. If wait_ms is AS_QUEUE_NOWAIT (0), the function will not wait.
The return value is true if an entry was successfully retrieved.
|
inlinestatic |
Push to the tail of the queue.
Definition at line 124 of file as_queue_mt.h.
References as_queue_push(), as_queue_mt::cond, as_queue_mt::lock, and as_queue_mt::queue.
|
inlinestatic |
Push to the front of the queue.
Definition at line 156 of file as_queue_mt.h.
References as_queue_push_head(), as_queue_mt::cond, as_queue_mt::lock, and as_queue_mt::queue.
|
inlinestatic |
Push to the front of the queue only if size < capacity.
Definition at line 172 of file as_queue_mt.h.
References as_queue_push_head_limit(), as_queue_mt::cond, as_queue_mt::lock, and as_queue_mt::queue.
|
inlinestatic |
Push element on the queue only if size < capacity.
Definition at line 140 of file as_queue_mt.h.
References as_queue_push_limit(), as_queue_mt::cond, as_queue_mt::lock, and as_queue_mt::queue.
|
inlinestatic |
Get the number of elements currently in the queue.
Definition at line 100 of file as_queue_mt.h.
References as_queue_size(), as_queue_mt::lock, and as_queue_mt::queue.