#include <bqueue.h>
Public Member Functions | |
BlockingQueue (int capacity_=-1) | |
void | setCapacity (int capacity_) |
int | getCapacity () const |
void | produce (T chunk) |
T | consume () |
size_t | size () const |
bool | empty () const |
A synchronized, blocking queue of chunks. This provides a way for chunks to be passed between worker threads.
The 'produce' operation is used to insert a chunk into the queue. This operation blocks if the capacity of the queue has been reached.
The 'consume' operation is used to obtain a remove a chunk from the queue, returning it to the consumer. This operation blocks if there are no chunks in the queue.