49# ifndef Q_CONSUMER_THREADS_H
50# define Q_CONSUMER_THREADS_H
53# include <condition_variable>
134 std::unique_lock<std::mutex>
cs(
lck);
136 <<
"~QueueTheadsPool: shutdown not done";
160 <<
"Thread creation with an event owned by another";
173 q.put(std::forward<T>(item));
249 event->item =
q.get();
Exception handling system with formatted messages for Aleph-w.
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
Dynamic queue of elements of generic type T based on single linked list.
Dynamic singly linked list with functional programming support.
T & append(const T &item)
Append a new item by copy.
constexpr bool is_empty() const noexcept
Return true if list is empty.
bool run()=0
this is a item extracted from the queue
std::atomic< Status > status
virtual ~ConsumerQueueEvent()
virtual void run()=0
this is a item extracted from the queue
Pool of consumer threads form a queue.
std::condition_variable cond
DynList< ConsumerQueueEvent * > event_list
static void handler(QueueTheadsPool< T > *threads_pool, ConsumerQueueEvent *event)
std::condition_variable shutdown_cv
void run_event(ConsumerQueueEvent *event)
void create_thread(ConsumerQueueEvent *event)
std::decay_t< typename HeadC::Item_Type > T
DynList< T > maps(const C &c, Op op)
Classic map operation.
Dynamic queue implementation based on linked lists.