chsvlib
chsv helper source code

◆ chsv_event_set()

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

Sets the specified event to a signalled 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.

The state of a manual-reset event remains signalled until it is set explicitly to the nonsignalled state by the chsv_event_reset function. Any number of threads, blocked waiting for the event to be signalled, or threads that subsequently begin the waiting, can be released while the object's state is signalled.

The state of an auto-reset event object remains signalled until a single waiting thread is released, at which time the system automatically sets the state to nonsignalled. If no threads are waiting, the event object's state remains signalled.

Use the chsv_event_pulse function to affect only those threads that are blocked waiting for the event at the time of the call.

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

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