mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 01:26:58 +00:00
Implement switch_queue_pop_timeout() and refactor sofia_profile_worker_thread_run() to use it so it doesn't wake up too often
This commit is contained in:
@@ -78,6 +78,22 @@ APU_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data);
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data);
|
||||
|
||||
/**
|
||||
* pop/get an object from the queue, blocking if the queue is already empty
|
||||
*
|
||||
* @param queue the queue
|
||||
* @param data the data
|
||||
* @param timeout The amount of time in microseconds to wait. This is
|
||||
* a maximum, not a minimum. If the condition is signaled, we
|
||||
* will wake up before this time, otherwise the error APR_TIMEUP
|
||||
* is returned.
|
||||
* @returns APR_TIMEUP the request timed out
|
||||
* @returns APR_EINTR the blocking was interrupted (try again)
|
||||
* @returns APR_EOF if the queue has been terminated
|
||||
* @returns APR_SUCCESS on a successfull pop
|
||||
*/
|
||||
APU_DECLARE(apr_status_t) apr_queue_pop_timeout(apr_queue_t *queue, void **data, apr_interval_time_t timeout);
|
||||
|
||||
/**
|
||||
* push/add a object to the queue, returning immediatly if the queue is full
|
||||
*
|
||||
|
Reference in New Issue
Block a user