12 #ifndef ROC_CORE_MPSC_QUEUE_H_
13 #define ROC_CORE_MPSC_QUEUE_H_
15 #include "roc_core/atomic_ops.h"
39 template <
class T,
template <
class TT>
class OwnershipPolicy = RefCountedOwnership>
45 typedef typename OwnershipPolicy<T>::Pointer
Pointer;
69 OwnershipPolicy<T>::acquire(obj);
94 OwnershipPolicy<T>::release(*obj);
117 OwnershipPolicy<T>::release(*obj);
Multi-producer single-consumer queue internal implementation class.
void push_back(MpscQueueNode::MpscQueueData *node)
Add object to the end of the queue.
MpscQueueNode::MpscQueueData * pop_front(bool can_spin)
Remove object from the beginning of the queue.
Thread-safe lock-free node-based intrusive multi-producer single-consumer queue.
void push_back(T &obj)
Add object to the end of the queue. Can be called concurrently. Acquires ownership of obj....
Pointer pop_front_exclusive()
Remove object from the beginning of the queue (blocking version). Should NOT be called concurrently....
Pointer try_pop_front_exclusive()
Try to remove object from the beginning of the queue (non-blocking version). Should NOT be called con...
OwnershipPolicy< T >::Pointer Pointer
Pointer type.
Base class for non-copyable objects.
Multi-producer single-consumer queue internal implementation.
MpscQueueNode * container_of()
Get MpscQueueNode object that contains this ListData object.