12 #ifndef ROC_PACKET_CONCURRENT_QUEUE_H_
13 #define ROC_PACKET_CONCURRENT_QUEUE_H_
19 #include "roc_core/semaphore.h"
#define ROC_ATTR_NODISCARD
Emit warning if function result is not checked.
Thread-safe lock-free node-based intrusive multi-producer single-consumer queue.
Base class for non-copyable objects.
Optionally constructed object.
Concurrent blocking packet queue.
virtual ROC_ATTR_NODISCARD status::StatusCode write(const PacketPtr &packet)
Add packet to the queue. Wait-free operation.
ConcurrentQueue(Mode mode)
Initialize. mode defines whether reads will be blocking.
virtual ROC_ATTR_NODISCARD status::StatusCode read(PacketPtr &)
Read next packet. If reads are not concurrent, and queue is non-blocking, then reads are wait-free....
@ NonBlocking
Read operation returns null if queue is empty.
@ Blocking
Read operation blocks until queue is non-empty.
Multi-producer single-consumer queue.
Optionally constructed object.