|
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 | |
| void | push (const value_type &v) |
| Push value to the back of the queue. | |
| 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. | |
| bool | try_pop (value_type &v) |
| Extract value. | |
| bool | empty () const |
| void | lock () noexcept(bm::is_lock_noexcept< lock_type >::value) |
| lock the queue access | |
| bool | try_lock () noexcept(bm::is_lock_noexcept< lock_type >::value) |
| Try to lock the queue exclusively. | |
| void | unlock () noexcept(bm::is_lock_noexcept< lock_type >::value) |
| unlock the queue access | |
Protected Types | |
| typedef std::queue< value_type > | queue_type |
Protected Attributes | |
| std::mutex | signal_mut_ |
| signal mutex for q submissions | |
| std::condition_variable | queue_push_cond_ |
| mutex paired conditional | |
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.
| typedef Lock bm::queue_sync< Value, Lock >::lock_type |
Definition at line 133 of file bmthreadpool.h.
|
protected |
Definition at line 210 of file bmthreadpool.h.
| typedef Value bm::queue_sync< Value, Lock >::value_type |
Definition at line 132 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.
|
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 |
|
friend |
Definition at line 207 of file bmthreadpool.h.
|
protected |
mutex paired conditional
Definition at line 222 of file bmthreadpool.h.
|
mutableprotected |
signal mutex for q submissions
Definition at line 221 of file bmthreadpool.h.