26#ifndef MYSQL_HARNESS_WAITING_QUEUE_ADAPTOR_INCLUDED
27#define MYSQL_HARNESS_WAITING_QUEUE_ADAPTOR_INCLUDED
29#include <condition_variable>
73 if (
false ==
q_.dequeue(item)) {
102 lk, [
this, &item] {
return q_.enqueue(std::move(item)); });
117 if (
false ==
q_.enqueue(item)) {
provide waiting pop and push operator to thread-safe queues.
Definition: waiting_queue_adaptor.h:39
void notify_enqueueable()
Definition: waiting_queue_adaptor.h:130
void push(const value_type &item)
enqueue item into queue.
Definition: waiting_queue_adaptor.h:88
void push(value_type &&item)
Definition: waiting_queue_adaptor.h:97
bool try_push(const value_type &item)
enqueue an item into a queue if queue is not full.
Definition: waiting_queue_adaptor.h:116
std::condition_variable dequeueable_cond_
Definition: waiting_queue_adaptor.h:138
std::condition_variable enqueueable_cond_
Definition: waiting_queue_adaptor.h:141
std::mutex enqueueable_cond_mutex_
Definition: waiting_queue_adaptor.h:140
typename Q::value_type value_type
Definition: waiting_queue_adaptor.h:41
Q q_
Definition: waiting_queue_adaptor.h:135
value_type pop()
dequeue an item from a queue.
Definition: waiting_queue_adaptor.h:50
std::mutex dequeueable_cond_mutex_
Definition: waiting_queue_adaptor.h:137
bool try_pop(value_type &item)
dequeue an item from a queue if queue is not empty.
Definition: waiting_queue_adaptor.h:72
void notify_dequeueable()
Definition: waiting_queue_adaptor.h:125
uint16_t value_type
Definition: vt100.h:184