MySQL 9.1.0
Source Code Documentation
|
a unbounded multi-producer multi-consumer queue. More...
#include <mpmc_queue.h>
Classes | |
struct | Node |
Public Types | |
using | value_type = T |
Public Member Functions | |
MPMCQueueMS2Lock () | |
~MPMCQueueMS2Lock () | |
bool | enqueue (const T &item) |
enqueue an element. More... | |
bool | enqueue (T &&item) |
enqueue an element. More... | |
bool | dequeue (T &item) |
try to dequeue element. More... | |
Private Attributes | |
std::mutex | head_mutex_ |
std::mutex | tail_mutex_ |
Node * | head_ |
Node * | tail_ |
a unbounded multi-producer multi-consumer queue.
multiple threads can read and write at the same time into the queue
see:
using mysql_harness::MPMCQueueMS2Lock< T >::value_type = T |
|
inline |
|
inline |
|
inline |
try to dequeue element.
item | location of dequeued item if dequeue() was successful |
true | first item removed from the queue and assigned to item |
false | queue is empty |
|
inline |
enqueue an element.
item | item to enqueue |
true | item got assigned to queue |
|
inline |
enqueue an element.
item | item to enqueue |
true | item got assigned to queue |
|
private |
|
private |
|
private |
|
private |