- Test:
- verify lifecycle behaviour of threads managed by thread-wrapper.
- See also
- thread.hpp
-
ThreadWrapperBackground_test
-
ThreadWrapperJoin_test
Definition at line 52 of file thread-wrapper-lifecycle-test.cpp.
|
virtual | ~Test ()=default |
| this is an interface
|
|
lib::Random | makeRandGen () |
| build a dedicated new RandomGen, seeded from the default-Gen
|
|
virtual void | run (Arg arg)=0 |
|
void | seedRand () |
| draw a new random seed from a common nucleus, and re-seed the default-Gen.
|
|
static string | firstTok (Arg) |
| conveniently pick the first token from the argument line
|
|
static uint | firstVal (Arg, uint=1) |
| conveniently use some number given as argument, with optional default
|
|
◆ defaultWrapperLifecycle()
void defaultWrapperLifecycle |
( |
| ) |
|
|
inlineprivate |
◆ verifyThreadLifecycleHooks()
void verifyThreadLifecycleHooks |
( |
| ) |
|
|
inlineprivate |
◆ demonstrateExplicitThreadLifecycle()
void demonstrateExplicitThreadLifecycle |
( |
| ) |
|
|
inlineprivate |
- Test:
- verify a special setup to start a thread explicitly and to track the thread's lifecycle state.
- use a component to encapsulate the thread
- this TestThread component is managed in a
unique_ptr
- thus it is explicitly possible to be not in running state
- when starting the TestThread, a lifecycle callback is bound
- at termination this callback will clear the unique_ptr
- thus allocation and running state is tied to the lifecycle
Definition at line 124 of file thread-wrapper-lifecycle-test.cpp.
The documentation for this class was generated from the following file: