Поделиться через


event::wait_for_multiple Method

Waits for multiple events to become signaled.

_CRTIMP static size_t __cdecl wait_for_multiple(
   event ** _PPEvents,
   size_t _Count,
   bool _FWaitAll,
   unsigned int _Timeout = COOPERATIVE_TIMEOUT_INFINITE
);

Parameters

  • _PPEvents
    An array of events to wait on. The number of events within the array is indicated by the _Count parameter.

  • _Count
    The count of events within the array supplied in the _PPEvents parameter.

  • _FWaitAll
    If set to the value true, the parameter specifies that all events within the array supplied in the _PPEvents parameter must become signaled in order to satisfy the wait. If set to the value false, it specifies that any event within the array supplied in the _PPEvents parameter becoming signaled will satisfy the wait.

  • _Timeout
    Indicates the number of milliseconds before the wait times out. The value COOPERATIVE_TIMEOUT_INFINITE signifies that there is no timeout.

Return Value

If the wait was satisfied, the index within the array supplied in the _PPEvents parameter which satisfied the wait condition; otherwise, the value COOPERATIVE_WAIT_TIMEOUT to indicate that the wait timed out without the condition being satisfied.

Remarks

If the parameter _FWaitAll is set to the value true to indicate that all events must become signaled to satisfy the wait, the index returned by the function carries no special significance other than the fact that it is not the value COOPERATIVE_WAIT_TIMEOUT.

Requirements

Header: concrt.h

Namespace: Concurrency

See Also

Reference

event Class (Concurrency Runtime)

event::wait Method

COOPERATIVE_TIMEOUT_INFINITE Constant

COOPERATIVE_WAIT_TIMEOUT Constant