12#ifndef ROC_CORE_MPSC_QUEUE_H_
13#define ROC_CORE_MPSC_QUEUE_H_
15#include "roc_core/atomic_ops.h"
50 typedef typename OwnershipPolicy<T>::Pointer
Pointer;
74 OwnershipPolicy<T>::acquire(elem);
77 impl_.push_back(data);
97 Pointer elem = from_node_data_(data);
98 OwnershipPolicy<T>::release(*elem);
120 Pointer elem = from_node_data_(data);
121 OwnershipPolicy<T>::release(*elem);
128 return static_cast<Node&
>(elem).mpsc_queue_data();
131 static T* from_node_data_(MpscQueueData* data) {
132 return static_cast<T*
>(
static_cast<Node*
>(Node::mpsc_queue_node(data)));
Base class for MpscQueue element.
Thread-safe lock-free node-based intrusive multi-producer single-consumer queue.
OwnershipPolicy< T >::Pointer Pointer
Pointer type.
Pointer try_pop_front_exclusive()
Try to remove object from the beginning of the queue (non-blocking version). Should NOT be called con...
Pointer pop_front_exclusive()
Remove object from the beginning of the queue (blocking version). Should NOT be called concurrently....
void push_back(T &elem)
Add object to the end of the queue. Can be called concurrently. Acquires ownership of elem....
Multi-producer single-consumer queue internal implementation.
General-purpose building blocks and platform abstraction layer.
MpscQueue node internal data.
Reference counted object ownership.