Furrent
|
#include <sharing_queue.hpp>
Public Types | |
using | Error = typename policy::Queue< T >::Error |
using | Result = util::Result< T, Error > |
using | MutateFn = typename policy::Queue< T >::MutateFn |
Public Member Functions | |
SharedQueue () | |
Result | try_extract (const policy::IPolicy< T > &policy) |
void | insert (T &&work) |
template<typename... Args> | |
void | emplace (Args &&... args) |
void | mutate (MutateFn mutation) |
void | force_wakeup () |
Wake up all waiting threads. More... | |
void | wait_work () const |
Wait for a new item in the queue. More... | |
void | wait_empty () const |
Wait for the queue to be empty. More... | |
void | begin_skip_waiting () |
Wrapper of policy::Queue to make it thread-safe and add concurrency related functionalities
using fur::mt::SharedQueue< T >::Error = typename policy::Queue<T>::Error |
using fur::mt::SharedQueue< T >::MutateFn = typename policy::Queue<T>::MutateFn |
using fur::mt::SharedQueue< T >::Result = util::Result<T, Error> |
fur::mt::SharedQueue< Work >::SharedQueue |
void fur::mt::SharedQueue< T >::begin_skip_waiting |
Wake up all waiting threads and begins skipping work
void fur::mt::SharedQueue< T >::emplace | ( | Args &&... | args | ) |
Construct an insert a new work in the internal list
...args | args used in the constructor of work |
void fur::mt::SharedQueue< T >::force_wakeup |
Wake up all waiting threads.
void fur::mt::SharedQueue< T >::insert | ( | T && | work | ) |
Insert new work in the internal list
work | Work to be inserted |
void fur::mt::SharedQueue< T >::mutate | ( | MutateFn | mutation | ) |
Mutates the internal list of items in a locked way then signals all sleeping threads
auto fur::mt::SharedQueue< Work >::try_extract | ( | const policy::IPolicy< T > & | policy | ) |
Tries to extract work from the queue
policy | policy used to extract the element |
void fur::mt::SharedQueue< T >::wait_empty |
Wait for the queue to be empty.
void fur::mt::SharedQueue< T >::wait_work |
Wait for a new item in the queue.