axlPointer valvula_async_queue_timedpop ( ValvulaAsyncQueue queue,
long  microseconds 
)

Pop the first data available in the queue, locking the calling if no data is available, but bounding the waiting to the value provided.

The function is ensured to return with a reference to some data.

Parameters
queueThe queue where data will be required.
microsecondsThe period to wait. 1 second = 1.000.000 microseconds.
Returns
A reference to the next data available.
Parameters
queue
microseconds
Returns
A reference to the data queue, or NULL if the timeout is reached.

References valvula_cond_timedwait(), valvula_mutex_lock(), valvula_mutex_unlock(), and valvula_timeval_substract().

Referenced by valvula_hash_lock_until_changed().