Mono Class Library: System.Threading.WaitHandle Overview | Members

System.Threading.WaitHandle.WaitAny Method

Waits for any of the elements in the specified array to receive a signal.

[System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)]
public static int WaitAny (WaitHandle[] waitHandles)

Parameters

waitHandles
A System.Threading.WaitHandle array containing the objects for which the current instance will wait. This array cannot contain multiple references to the same object (duplicates).

Returns

Returns a int set to the index of the element in waitHandles that received a signal.

Exceptions

TypeReason
ArgumentNullExceptionwaitHandles is null or one or more elements in the waitHandles array is null.
DuplicateWaitObjectExceptionwaitHandles contains elements that are duplicates.
NotSupportedExceptionThe number of objects in waitHandles is greater than the system permits.

Remarks

The maximum number of objects specified in the waitHandles array is system defined.

Requirements

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0