chsvlib
chsv helper source code

◆ chsv_event_wait()

int Chusov::ExecutionControl::chsv_event_wait ( chsv_event_t pEvent)
noexcept

Blocks the calling thread until the specified event is signalled.

Parameters
[in]pEventis an identifier of the event created by chsv_event_init.
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.

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