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

◆ WaitForKickTimeoutIn() [1/2]

template<class Rep , class Period >
bool drama::thread::TAction::WaitForKickTimeoutIn ( const std::chrono::duration< Rep, Period > &  rel_time,
sds::IdPtr *const  arg = 0 
)
inlineinherited

Block the current thread until a kick for the action is received or a duration has passed.

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

Template Parameters
RepAn arithmetic type, or a class emulating an arithmetic type, to be used as the type for the internal count.
PeriodA ratio type that represents the period in seconds.
Parameters
rel_timeThe maximum time span during which the thread will block waiting to be notified. duration is an object that represents a specific relative time. Wait this length of 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.
Examples
threadbasic.cpp.

References drama::CreateRunDramaTask(), DramaTHROW, and drama::Kick.