56 if ((_capacity == 0) || (_queue.size() < _capacity))
63 _cv2.Wait(_cs, [
this]() {
return (_closed || (_capacity == 0) || (_queue.size() < _capacity)); });
80 if ((_capacity == 0) || (_queue.size() < _capacity))
87 _cv2.Wait(_cs, [
this]() {
return (_closed || (_capacity == 0) || (_queue.size() < _capacity)); });
99 if (_closed && _queue.empty())
106 item = _queue.front();
112 _cv1.Wait(_cs, [
this]() {
return (_closed || !_queue.empty()); });
114 }
while (!_closed || !_queue.empty());
Locker synchronization primitive.
bool Enqueue(const T &item)
Enqueue an item into the wait queue.
bool Dequeue(T &item)
Dequeue an item from the wait queue.
void Close()
Close the wait queue.
WaitQueue(size_t capacity=0)
Default class constructor.
size_t capacity() const
Get wait queue capacity.
bool closed() const
Is wait queue closed?
size_t size() const
Get wait queue size.
C++ Common project definitions.