Event class that avoids trips into the kernel when the event has been set previously.
Public Member Functions
|Event_t (bool initially_set=false, bool allow_timeouts_other_than_zero_or_infinite=false)|
|bool||Wait (int32 timeout_ms=-1)|
|void||Set (int release_count=1)|
|Event_t::Event_t||(||bool|| initially_set =
|bool|| allow_timeouts_other_than_zero_or_infinite = |
Event constructor. If a nonzero timeout is specified and it does time out, the atomic addition mechanism used to avoid trips into the kernel would have an unfixable race condition. Therefore, use timeouts other than zero or infinite (-1) only when necessary, and if any other timeout is used, the event must have been constructed to allow that. Using that type of event inevitably degrades its performance.
|bool Event_t::Wait||(||int32|| timeout_ms =
Waits for the event to be set, or until the specified timeout has elapsed. Returns true if the event has been set and acquired, false if the timeout elapsed. If timeout_ms is specified to be -1, the function will wait indefinitely.
|void Event_t::Set||(||int|| release_count =
Sets the event, possibly releasing more than one waiting thread depending on release_count.