AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface

◆ WaitEventTimeoutAt()

template<class Clock , class Duration >
bool drama::thread::TAction::WaitEventTimeoutAt ( EntryCode event,
const std::chrono::time_point< Clock, Duration > &  abs_time,
sds::IdPtr *const  arg = 0 
)
inlineinherited

Block the current thread until a signal/kick for the action is received or until a given time.

Note - in an action with multiple subsidiary threads, any number of the threads can block waiting for a signal/kick. They will all be woken up when the signal/kick occurs.

tparam Clock A clock class, such as system_clock, steady_clock, high_resolution_clock or a custom clock class. tparam Duration A duration type.

Parameters
eventThe entry reason. EntryCode::Kick or EntryCode::Signal. If a timeout occurs, will by EntryCode::DramaAbortWaits.
abs_timeA point in time at which the thread will stop blocking, allowing the function to return. time_point is an object that represents a specific absolute time.
argThe argument to the kick, if any. An address of and sds::IdPtr is supplied. If you supply a
null pointer, it is ignored. Otherwise, any argument to the kick is copied into here. If there is no argument to the kick, it will refer to a null SDS item.
Returns
Returns true if the kick was received, false for a timeout.

References drama::CreateRunDramaTask(), and D2LOG_DRAMA2.