26#ifndef MYSQL_HARNESS_MPMC_UNBOUND_QUEUE_INCLUDED
27#define MYSQL_HARNESS_MPMC_UNBOUND_QUEUE_INCLUDED
109 node->
data = std::move(item);
131 Node *node =
nullptr;
138 if (new_head ==
nullptr) {
142 item = std::move(new_head->
data);
155 std::atomic<Node *>
next{
nullptr};
a unbounded multi-producer multi-consumer queue.
Definition: mpmc_queue.h:60
bool enqueue(T &&item)
enqueue an element.
Definition: mpmc_queue.h:107
std::mutex head_mutex_
Definition: mpmc_queue.h:158
bool dequeue(T &item)
try to dequeue element.
Definition: mpmc_queue.h:130
Node * tail_
Definition: mpmc_queue.h:161
~MPMCQueueMS2Lock()
Definition: mpmc_queue.h:66
Node * head_
Definition: mpmc_queue.h:160
bool enqueue(const T &item)
enqueue an element.
Definition: mpmc_queue.h:85
MPMCQueueMS2Lock()
Definition: mpmc_queue.h:64
std::mutex tail_mutex_
Definition: mpmc_queue.h:159
T value_type
Definition: mpmc_queue.h:62
provide waiting pop and push operator to thread-safe queues.
Definition: waiting_queue_adaptor.h:39
Definition: mpmc_queue.h:153
std::atomic< Node * > next
Definition: mpmc_queue.h:155
T data
Definition: mpmc_queue.h:154