chsvlib
chsv helper source code

◆ chsv_event_pulse()

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

Sets the specified event to the signalled state, releasing appropriate number of threads that are waiting for the signal, and resets the event back to the nonsignalled state.

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.

For a manual-reset event object, all waiting threads are released. The function then resets the state of the event to nonsignalled and returns.

For an auto-reset event object, the function resets the state to nonsignalled and returns after releasing a single waiting thread, even if multiple threads are waiting.

If no threads are waiting the chsv_event_pulse function simply sets the state of the event to nonsignalled and returns.

The function does not correspond to any of the C11 functions but partially corresponds to Win32 PulseEvent function.

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