WaitHandle.WaitAny Method (WaitHandle)
February 14, 2014
Waits for any of the elements in the specified array to receive a signal.
Assembly: mscorlib (in mscorlib.dll)
This method returns when any handle is signaled. If more than one object becomes signaled during the call, the return value is the array index of the signaled object with the smallest index value of all the signaled objects. On some implementations, if more that 64 handles are passed, a NotSupportedException is thrown.
The following example demonstrates how to call the WaitAny method to wait for the first of several threads to finish.
This code is part of a larger example provided for the WaitAll(WaitHandle) method overload.