![]() |
Lumiera 0.pre.04
»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 165 of file thread.hpp.
Public Attributes | |
| const string | threadID_ |
| std::thread | threadImpl_ |
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 Member Functions | |
| bool | isLive () const |
| ThreadWrapper () | |
| ThreadWrapper (string const &threadID) | |
| template<class... INVO> | |
| void | launchThread (tuple< INVO... > &&invocation) |
| bool | invokedWithinThread () const |
| detect if the currently executing code runs within this thread | |
| void | markThreadStart () |
| void | markThreadEnd () |
| void | setThreadName () |
| void | waitGracePeriod () noexcept |
| void | handle_begin_thread () |
| called immediately at start of thread | |
| void | handle_after_thread () |
| called immediately before end of thread | |
| void | handle_loose_thread () |
| called when destroying wrapper on still running thread | |
| void | detach_thread_from_wrapper () |
| allow to detach explicitly — independent from thread-function's state. | |
Additional Inherited Members | |
Protected Member Functions inherited from MoveOnly | |
| ~MoveOnly ()=default | |
| MoveOnly ()=default | |
| 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 175 of file thread.hpp.
|
inline |
Definition at line 180 of file thread.hpp.
|
inline |
Definition at line 171 of file thread.hpp.
References ThreadWrapper::threadImpl_.
Referenced by ThreadWrapper::detach_thread_from_wrapper(), and ThreadWrapper::launchThread().
Here is the caller graph for this function:
|
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 201 of file thread.hpp.
References ThreadWrapper::isLive(), and ThreadWrapper::threadImpl_.
Here is the call graph for this function:| bool invokedWithinThread | ( | ) | const |
detect if the currently executing code runs within this thread
Definition at line 65 of file thread.cpp.
References ThreadWrapper::threadImpl_.
| void markThreadStart | ( | ) |
Definition at line 72 of file thread.cpp.
References ThreadWrapper::setThreadName(), and ThreadWrapper::threadID_.
Here is the call graph for this function:| void markThreadEnd | ( | ) |
Definition at line 80 of file thread.cpp.
References ThreadWrapper::threadID_.
| void setThreadName | ( | ) |
Definition at line 87 of file thread.cpp.
References ThreadWrapper::threadID_, and ThreadWrapper::threadImpl_.
Referenced by ThreadWrapper::markThreadStart().
Here is the caller graph for this function:
|
noexcept |
Definition at line 97 of file thread.cpp.
References ERROR_LOG_AND_IGNORE, ThreadWrapper::threadID_, and ThreadWrapper::threadImpl_.
|
inline |
called immediately at start of thread
Definition at line 217 of file thread.hpp.
|
inline |
called immediately before end of thread
Definition at line 218 of file thread.hpp.
|
inline |
called when destroying wrapper on still running thread
Definition at line 219 of file thread.hpp.
|
static |
Helper to create a suffix to the thread-ID with running count.
Definition at line 56 of file thread.cpp.
|
inline |
allow to detach explicitly — independent from thread-function's state.
Definition at line 231 of file thread.hpp.
References ThreadWrapper::isLive(), and ThreadWrapper::threadImpl_.
Referenced by SchedulerCommutator_test::blockGroomingToken(), ThreadWrapperLifecycle_test::demonstrateExplicitThreadLifecycle(), and lib::launchDetached().
Here is the call graph for this function:
Here is the caller graph for this function:| const string threadID_ |
Definition at line 168 of file thread.hpp.
Referenced by ThreadWrapper::markThreadEnd(), ThreadWrapper::markThreadStart(), ThreadWrapper::setThreadName(), and ThreadWrapper::waitGracePeriod().
| std::thread threadImpl_ |
Definition at line 169 of file thread.hpp.
Referenced by ThreadWrapper::detach_thread_from_wrapper(), ThreadWrapper::invokedWithinThread(), ThreadWrapper::isLive(), ThreadWrapper::launchThread(), ThreadWrapper::setThreadName(), and ThreadWrapper::waitGracePeriod().
Inheritance diagram for ThreadWrapper:
Collaboration diagram for ThreadWrapper: