xtd 0.2.0
Loading...
Searching...
No Matches

◆ wait_any() [2/3]

template<typename collection_t >
static size_t xtd::threading::wait_handle::wait_any ( const collection_t &  wait_handles,
int32  milliseconds_timeout 
)
inlinestatic

Waits for any of the elements in the specified collection to receive a signal, using a 32-bit signed integer to measure the time interval.

Parameters
wait_handlesA xtd::threading::wait_handle collection containing the objects for which the current instance will wait. This array cannot contain multiple references to the same object.
milliseconds_timeoutThe number of milliseconds to wait, or xtd::threading::timeout::infinite (-1) to wait indefinitely.
Returns
The array index of the object that satisfied the wait, or xtd::threading::wait_handle::wait_timeout if no object satisfied the wait and a time interval equivalent to milliseconds_timeout has passed.
Exceptions
xtd::argument_exceptiontimeout is a negative number other than -1 milliseconds, which represents an infinite time-out.
-or-
The number of objects in wait_handles is greater than the system permits.
xtd::object_closed_exceptionthe to_signal and/or to_wait are invalid
xtd::argument_exceptionThe number of objects in wait_handles is greater than the system permits.
xtd::threading::abandoned_mutex_exceptionThe wait completed because a thread exited without releasing a mutex.