LockedQueue

Locked queue for inter-thread communication. Support multiple writers, multiple readers. Blocks threads either when empty or full. @nogc once in use.

Constructors

this
this(size_t capacity)

Creates a locked queue with an initial capacity.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Postblit

A postblit is present on this object, but not explicitly documented in the source.

Members

Functions

capacity
size_t capacity()
clear
void clear()

Removes all locked queue items.

popBack
T popBack()

Pop an item from the back, block if queue is empty.

popFront
T popFront()

Pop an item from the front, block if queue is empty.

pushBack
void pushBack(T x)

Push an item to the back, block if queue is full.

pushFront
void pushFront(T x)

Push an item to the front, block if queue is full.

tryPopBack
bool tryPopBack(T result)

Tries to pop an item from the back immediately. Returns: true if an item was returned, false if the queue is empty.

tryPopFront
bool tryPopFront(T result)

Tries to pop an item from the front immediately. Returns: true if an item was returned, false if the queue is empty.

See Also

Meta