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

◆ wait_any() [3/3]

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

Waits for any of the elements in the specified collection to receive a signal, using a xtd::time_span 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.
timeoutA xtd::time_span that represents the number of milliseconds to wait, or a xtd::time_span that represents -1 milliseconds 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 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.