Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/thread.hpp"
wraps the C++ thread handle and provides some implementation details, which are then combined by the policy template
Definition at line 173 of file thread.hpp.
Public Member Functions | |
ThreadWrapper () | |
ThreadWrapper (string const &threadID) | |
void | detach_thread_from_wrapper () |
allow to detach explicitly — independent from thread-function's state. More... | |
void | handle_after_thread () |
called immediately before end of thread | |
void | handle_begin_thread () |
called immediately at start of thread | |
void | handle_loose_thread () |
called when destroying wrapper on still running thread | |
bool | invokedWithinThread () const |
detect if the currently executing code runs within this thread More... | |
bool | isLive () const |
template<class... INVO> | |
void | launchThread (tuple< INVO... > &&invocation) |
void | markThreadEnd () |
void | markThreadStart () |
void | setThreadName () |
void | waitGracePeriod () noexcept |
Static Public Member Functions | |
static string | decorate_with_global_count (string const &) |
Helper to create a suffix to the thread-ID with running count. | |
Public Attributes | |
const string | threadID_ |
std::thread | threadImpl_ |
Additional Inherited Members | |
Protected Member Functions inherited from MoveOnly | |
MoveOnly (MoveOnly &&)=default | |
MoveOnly (MoveOnly const &)=delete | |
MoveOnly & | operator= (MoveOnly &&)=delete |
MoveOnly & | operator= (MoveOnly const &)=delete |
|
inline |
derived classes may create an inactive thread
Definition at line 183 of file thread.hpp.
|
inline |
actually launch the new thread. Deliberately the #threadImpl_ is created empty, to allow for complete initialisation of all the combined policy classes stacked on top
invocation | a tuple holding some invokable and possible arguments, together forming the threadFunction to be executed in the new thread. |
Definition at line 209 of file thread.hpp.
bool invokedWithinThread | ( | ) | const |
detect if the currently executing code runs within this thread
Definition at line 74 of file thread.cpp.
References ERROR_LOG_AND_IGNORE.
Referenced by DispatcherLoop::runSessionThread().
|
inline |
allow to detach explicitly — independent from thread-function's state.
Definition at line 239 of file thread.hpp.
Referenced by SchedulerCommutator_test::blockGroomingToken(), and DispatcherLoop::DispatcherLoop().