Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
ThreadHookable Class Reference

#include "lib/thread.hpp"

Description

Extended variant of the standard case, allowing to install callbacks (hook functions) to be invoked during thread lifecycle:

  • atStart : invoked as first user code in the new thread
  • atExit : invoked as the last user code prior to detaching and thread end
  • onOrphan : invoked from the thread-wrapper destructor, when the actual thread is detected as still running (according to the thread handle) By default, these callbacks are empty; custom callbacks can be installed through the ThreadLifecycle::Launch configuration builder using the corresponding builder functions (e.g. .atExit(λ)). The passed functor can either take no argument, or a single argument with a reference to some *this subtype, which must be reachable by static downcast from the ThreadLifecycle base type.

Definition at line 716 of file thread.hpp.

Additional Inherited Members

- Static Public Member Functions inherited from ThreadLifecycle< thread::PolicyLifecycleHook >
static auto buildInvocation (W &wrapper, tuple< INVO... > &&invocation)
 Build the invocation tuple, using invokeThreadFunction to delegate to the user-provided functor and arguments.
 
static auto buildLauncher (INVO &&...args)
 Build a λ actually to launch the given thread operation later, after the thread-wrapper-object is fully initialised.
 
- Public Member Functions inherited from ThreadLifecycle< thread::PolicyLifecycleHook >
 ThreadLifecycle (Launch launcher)
 Primary constructor: Launch the new thread with flexible configuration.
 
 ThreadLifecycle (string const &threadID, FUN &&threadFunction, ARGS &&...args)
 Create a new thread to execute the given operation.
 
 ThreadLifecycle (void(SUB::*memFun)(ARGS...), ARGS ...args)
 Special variant to bind a subclass member function as thread operation.
 
 operator bool () const
 Is this thread »active« and thus tied to OS resources?
 
- Protected Member Functions inherited from ThreadLifecycle< thread::PolicyLifecycleHook >
 ~ThreadLifecycle ()
 
 ThreadLifecycle ()
 derived classes may create a disabled thread
 
+ Inheritance diagram for ThreadHookable:
+ Collaboration diagram for ThreadHookable:

The documentation for this class was generated from the following file: