axlPointer myqtt_async_queue_timedpop ( MyQttAsyncQueue 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 myqtt_cond_timedwait(), myqtt_mutex_lock(), myqtt_mutex_unlock(), and myqtt_timeval_substract().

Referenced by myqtt_conn_get_next(), myqtt_conn_ping(), myqtt_hash_lock_until_changed(), and myqttd_ctx_wait().