RTS API Documentation
1.10.11
|
#include <fspr_pools.h>
#include <fspr_hash.h>
#include <fspr_strings.h>
#include <fspr_general.h>
#include <fspr_portable.h>
Go to the source code of this file.
Typedefs | |
typedef struct switch_apr_queue_t | switch_apr_queue_t |
Functions | |
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) |
typedef struct switch_apr_queue_t switch_apr_queue_t |
Definition at line 55 of file switch_apr_pvt.h.
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().