BitMagic-C++
|
Thread-sync queue with MT access protecion. More...
#include <bmthreadpool.h>
Public Types | |
typedef Value | value_type |
typedef Lock | lock_type |
Public Member Functions | |
queue_sync () noexcept | |
constructor More... | |
void | push (const value_type &v) |
Push value to the back of the queue. More... | |
void | push_no_lock (const value_type &v) |
Push value to the back of the queue without lock protection It is assumed that processing did not start and we are just staging the batch. More... | |
bool | try_pop (value_type &v) |
Extract value. More... | |
bool | empty () const |
More... | |
void | lock () noexcept(bm::is_lock_noexcept< lock_type >::value) |
lock the queue access More... | |
bool | try_lock () noexcept(bm::is_lock_noexcept< lock_type >::value) |
Try to lock the queue exclusively. More... | |
void | unlock () noexcept(bm::is_lock_noexcept< lock_type >::value) |
unlock the queue access More... | |
Protected Types | |
typedef std::queue< value_type > | queue_type |
Protected Attributes | |
std::mutex | signal_mut_ |
signal mutex for q submissions More... | |
std::condition_variable | queue_push_cond_ |
mutex paired conditional More... | |
Friends | |
template<typename QV , typename L > | |
class | bm::thread_pool |
Thread-sync queue with MT access protecion.
Definition at line 129 of file bmthreadpool.h.
|
inlinenoexcept |
constructor
Definition at line 137 of file bmthreadpool.h.
|
inline |
Definition at line 181 of file bmthreadpool.h.
|
inlinenoexcept |
|
inline |
Push value to the back of the queue.
v | - value to put in the queue |
Definition at line 144 of file bmthreadpool.h.
References bm::queue_sync< Value, Lock >::queue_push_cond_.
|
inline |
Push value to the back of the queue without lock protection It is assumed that processing did not start and we are just staging the batch.
v | - value to put in the queue |
Definition at line 160 of file bmthreadpool.h.
|
inlinenoexcept |
Try to lock the queue exclusively.
Definition at line 194 of file bmthreadpool.h.
|
inline |
Extract value.
v | - [out] value returned |
Definition at line 170 of file bmthreadpool.h.
|
inlinenoexcept |
unlock the queue access
Definition at line 199 of file bmthreadpool.h.
References bm::queue_sync< Value, Lock >::queue_push_cond_.
|
protected |
mutex paired conditional
Definition at line 222 of file bmthreadpool.h.
Referenced by bm::queue_sync< Value, Lock >::push(), and bm::queue_sync< Value, Lock >::unlock().
|
mutableprotected |
signal mutex for q submissions
Definition at line 221 of file bmthreadpool.h.