chsvlib
chsv helper source code

◆ chsv_event_timedwait()

int Chusov::ExecutionControl::chsv_event_timedwait ( chsv_event_t pEvent,
chsv_xtime xt 
)
noexcept

Blocks the calling thread until either the specified event is signalled or until after the time specified by the chsv_xtime object.

Parameters
[in]pEventis an identifier of the event created by chsv_event_init.
[in]xtis a pointer to a chsv_xtime object specifying an absolute time passed since the Epoch when the function will return because of timeout.
Returns
The function returns chsv_thrd_success on success and chsv_thrd_error on failure. In the last case the function also sets the corresponding errno code.

If multiple threads wait for the same auto-reset event to become signalled, only one of them is released because the event is automatically reset. If multiple threads wait are are going to wait for a manual-reset event to be signalled, and the event is set by a call to chsv_event_set, all of them will be released until the event is explicitly reset by the call to chsv_event_reset.

If the event is signalled by chsv_event_pulse, only those threads are affected (obeying the same rule for manual-reset and auto-reset events) that are waiting at the moment of the signal.

An absolute time is a time passed since the Epoch. See chsv_xtime_get for more details.

To specify a relative time use the chsv_event_timedwaitfor function.

See also
chsv_event_set;
chsv_event_pulse;
chsv_event_reset;
chsv_event_wait;
chsv_event_timedwaitfor.