RTS API Documentation
1.10.11
|
Go to the source code of this file.
Data Structures | |
struct | switch_apr_queue_t |
Macros | |
#define | Q_DBG(x, y) |
#define | apr_queue_full(queue) ((queue)->nelts == (queue)->bounds) |
#define | apr_queue_empty(queue) ((queue)->nelts == 0) |
Typedefs | |
typedef struct switch_apr_queue_t | switch_apr_queue_t |
Functions | |
static fspr_status_t | queue_destroy (void *data) |
fspr_status_t | switch_apr_queue_create (switch_apr_queue_t **q, unsigned int queue_capacity, fspr_pool_t *a) |
fspr_status_t | switch_apr_queue_push (switch_apr_queue_t *queue, void *data) |
fspr_status_t | switch_apr_queue_trypush (switch_apr_queue_t *queue, void *data) |
unsigned int | switch_apr_queue_size (switch_apr_queue_t *queue) |
fspr_status_t | switch_apr_queue_pop (switch_apr_queue_t *queue, void **data) |
fspr_status_t | switch_apr_queue_pop_timeout (switch_apr_queue_t *queue, void **data, fspr_interval_time_t timeout) |
fspr_status_t | switch_apr_queue_trypop (switch_apr_queue_t *queue, void **data) |
fspr_status_t | switch_apr_queue_interrupt_all (switch_apr_queue_t *queue) |
fspr_status_t | switch_apr_queue_term (switch_apr_queue_t *queue) |
#define apr_queue_empty | ( | queue | ) | ((queue)->nelts == 0) |
Detects when the switch_apr_queue_t is empty. This utility function is expected to be called from within critical sections, and is not threadsafe.
Definition at line 66 of file switch_apr_queue.c.
Referenced by switch_apr_queue_pop(), switch_apr_queue_pop_timeout(), and switch_apr_queue_trypop().
#define apr_queue_full | ( | queue | ) | ((queue)->nelts == (queue)->bounds) |
Detects when the switch_apr_queue_t is full. This utility function is expected to be called from within critical sections, and is not threadsafe.
Definition at line 60 of file switch_apr_queue.c.
Referenced by switch_apr_queue_push(), and switch_apr_queue_trypush().
#define Q_DBG | ( | x, | |
y | |||
) |
Definition at line 53 of file switch_apr_queue.c.
Referenced by switch_apr_queue_interrupt_all(), switch_apr_queue_pop(), switch_apr_queue_pop_timeout(), switch_apr_queue_push(), switch_apr_queue_trypop(), and switch_apr_queue_trypush().
typedef struct switch_apr_queue_t switch_apr_queue_t |
Definition at line 42 of file switch_apr_queue.c.
|
static |
Callback routine that is called to destroy this switch_apr_queue_t when its pool is destroyed.
Definition at line 72 of file switch_apr_queue.c.
References switch_apr_queue_t::data, switch_apr_queue_t::not_empty, switch_apr_queue_t::not_full, and switch_apr_queue_t::one_big_mutex.
Referenced by switch_apr_queue_create().
fspr_status_t switch_apr_queue_create | ( | switch_apr_queue_t ** | q, |
unsigned int | queue_capacity, | ||
fspr_pool_t * | a | ||
) |
Initialize the switch_apr_queue_t.
Definition at line 88 of file switch_apr_queue.c.
References switch_apr_queue_t::bounds, switch_apr_queue_t::data, switch_apr_queue_t::empty_waiters, switch_apr_queue_t::full_waiters, switch_apr_queue_t::in, memset(), switch_apr_queue_t::nelts, switch_apr_queue_t::not_empty, switch_apr_queue_t::not_full, switch_apr_queue_t::one_big_mutex, switch_apr_queue_t::out, queue_destroy(), and switch_apr_queue_t::terminated.
Referenced by switch_queue_create().
fspr_status_t switch_apr_queue_interrupt_all | ( | switch_apr_queue_t * | queue | ) |
Definition at line 406 of file switch_apr_queue.c.
References switch_apr_queue_t::not_empty, switch_apr_queue_t::not_full, switch_apr_queue_t::one_big_mutex, and Q_DBG.
Referenced by switch_apr_queue_term(), and switch_queue_interrupt_all().
fspr_status_t switch_apr_queue_pop | ( | switch_apr_queue_t * | queue, |
void ** | data | ||
) |
Retrieves the next item from the queue. If there are no items available, it will block until one becomes available. Once retrieved, the item is placed into the address specified by 'data'.
Definition at line 244 of file switch_apr_queue.c.
References apr_queue_empty, switch_apr_queue_t::bounds, switch_apr_queue_t::data, switch_apr_queue_t::empty_waiters, switch_apr_queue_t::full_waiters, if(), switch_apr_queue_t::nelts, switch_apr_queue_t::not_empty, switch_apr_queue_t::not_full, switch_apr_queue_t::one_big_mutex, switch_apr_queue_t::out, Q_DBG, and switch_apr_queue_t::terminated.
Referenced by switch_queue_pop().
fspr_status_t switch_apr_queue_pop_timeout | ( | switch_apr_queue_t * | queue, |
void ** | data, | ||
fspr_interval_time_t | timeout | ||
) |
Retrieves the next item from the queue. If there are no items available, it will block until one becomes available, or until timeout is elapsed. Once retrieved, the item is placed into the address specified by'data'.
Definition at line 307 of file switch_apr_queue.c.
References apr_queue_empty, switch_apr_queue_t::bounds, switch_apr_queue_t::data, switch_apr_queue_t::empty_waiters, switch_apr_queue_t::full_waiters, if(), switch_apr_queue_t::nelts, switch_apr_queue_t::not_empty, switch_apr_queue_t::not_full, switch_apr_queue_t::one_big_mutex, switch_apr_queue_t::out, Q_DBG, and switch_apr_queue_t::terminated.
Referenced by switch_queue_pop_timeout().
fspr_status_t switch_apr_queue_push | ( | switch_apr_queue_t * | queue, |
void * | data | ||
) |
Push new data onto the queue. Blocks if the queue is full. Once the push operation has completed, it signals other threads waiting in apr_queue_pop() that they may continue consuming sockets.
Definition at line 135 of file switch_apr_queue.c.
References apr_queue_full, switch_apr_queue_t::bounds, switch_apr_queue_t::data, switch_apr_queue_t::empty_waiters, switch_apr_queue_t::full_waiters, if(), switch_apr_queue_t::in, switch_apr_queue_t::nelts, switch_apr_queue_t::not_empty, switch_apr_queue_t::not_full, switch_apr_queue_t::one_big_mutex, Q_DBG, and switch_apr_queue_t::terminated.
Referenced by switch_queue_push().
unsigned int switch_apr_queue_size | ( | switch_apr_queue_t * | queue | ) |
not thread safe
Definition at line 234 of file switch_apr_queue.c.
References switch_apr_queue_t::nelts.
Referenced by switch_queue_size().
fspr_status_t switch_apr_queue_term | ( | switch_apr_queue_t * | queue | ) |
Definition at line 423 of file switch_apr_queue.c.
References switch_apr_queue_t::one_big_mutex, switch_apr_queue_interrupt_all(), and switch_apr_queue_t::terminated.
Referenced by switch_queue_term().
fspr_status_t switch_apr_queue_trypop | ( | switch_apr_queue_t * | queue, |
void ** | data | ||
) |
Retrieves the next item from the queue. If there are no items available, return APR_EAGAIN. Once retrieved, the item is placed into the address specified by 'data'.
Definition at line 371 of file switch_apr_queue.c.
References apr_queue_empty, switch_apr_queue_t::bounds, switch_apr_queue_t::data, switch_apr_queue_t::full_waiters, if(), switch_apr_queue_t::nelts, switch_apr_queue_t::not_full, switch_apr_queue_t::one_big_mutex, switch_apr_queue_t::out, Q_DBG, and switch_apr_queue_t::terminated.
Referenced by switch_queue_trypop().
fspr_status_t switch_apr_queue_trypush | ( | switch_apr_queue_t * | queue, |
void * | data | ||
) |
Push new data onto the queue. Blocks if the queue is full. Once the push operation has completed, it signals other threads waiting in apr_queue_pop() that they may continue consuming sockets.
Definition at line 196 of file switch_apr_queue.c.
References apr_queue_full, switch_apr_queue_t::bounds, switch_apr_queue_t::data, switch_apr_queue_t::empty_waiters, if(), switch_apr_queue_t::in, switch_apr_queue_t::nelts, switch_apr_queue_t::not_empty, switch_apr_queue_t::one_big_mutex, Q_DBG, and switch_apr_queue_t::terminated.
Referenced by switch_queue_trypush().