vt::ctx::TD struct

Context for termination detection to be preserved with a task. Manages the epoch stack associated with running tasks. Produces and consumes in the constructor and destructor to ensure termination is not detected early.

Constructors, destructors, conversion operators

TD() defaulted
TD(EpochType in_ep) explicit
Construct with a given epoch; produce on that epoch.
template<typename MsgPtrT>
TD(MsgPtrT const& msg) explicit
Construct with a message to extract the epoch; produce on that epoch.

Public functions

void start()
During start TD will capture the epoch stack size and push ep_.
void finish()
During finish TD will pop all epochs off of the stack down to the size it captured in start()
void suspend()
When suspended, TD will preserve any epochs pushed on the stack after begin and restore the stack back to the state before begin was invoked.
void resume()
When resumed, TD will restore the stack back from when it was suspended.

Function documentation

vt::ctx::TD::TD(EpochType in_ep) explicit

Construct with a given epoch; produce on that epoch.

Parameters
in_ep in the epoch

template<typename MsgPtrT>
vt::ctx::TD::TD(MsgPtrT const& msg) explicit

Construct with a message to extract the epoch; produce on that epoch.

Parameters
msg in the message to extract the epoch from