|
noexcept |
Blocks the calling thread until either the specified event is signalled or until the specified amount of time elapses.
[in] | pEvent | is an identifier of the event created by chsv_event_init. |
[in] | cMilliseconds | is a time interval for which the blocking is performed. After this time, specified in milliseconds, the function will timeout without acquiring the ownership of the event. |
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.
The function implements waiting for an amount of time since the time of the call. Absolute time can be specified to a call to the chsv_event_timedwait function.