|
Bredbandskollen CLI
1.2
Asynchronous network task engine
|
Thread safe queue. More...
#include <msgqueue.h>
Public Member Functions | |
| void | push (T t) |
| Add object at the end of the queue. | |
| bool | empty () |
| Return true if the queue is empty. | |
| T | pop_blocking () |
| Wait until there is an object in the queue, then remove and return the first object. | |
| bool | fetch (T &val) |
| A non-blocking pop. More... | |
Thread safe queue.
By design, there is no method named pop. To retrieve an object from the queue, you must use either the non-blocking MsgQueue::fetch or the blocking MsgQueue::pop_blocking method.
|
inline |
A non-blocking pop.
If the queue is empty, return false. Otherwise remove the first object from the queue, assign it to val, and return true.