NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

WaitHandle.WaitAny (WaitHandle[], TimeSpan, Boolean)

[To be supplied.]

[Visual Basic]
Overloads Public Shared Function WaitAny( _
   ByVal waitHandles() As WaitHandle, _
   ByVal timeout As TimeSpan, _
   ByVal exitContext As Boolean _
) As Integer
[C#]
public static int WaitAny(
   WaitHandle[] waitHandles,
   TimeSpan timeout,
   bool exitContext
);
[C++]
public: static int WaitAny(
   WaitHandle* waitHandles[],
   TimeSpan timeout,
   bool exitContext
);
[JScript]
public static function WaitAny(
   waitHandles : WaitHandle[],
   timeout : TimeSpan,
   exitContext : Boolean
) : int;

Parameters

waitHandles
An array of WaitHandles.
timeout
A time-out period.
exitContext
[To be supplied.]

Return Value

The return value minus WaitObject indicates the array index of the object that satisfied the wait. If more than one object became signaled during the call, this is the array index of the signaled object with the smallest index value of all the signaled objects.

Exceptions

Exception Type Condition
ArgumentNullException If any of the objects in the waitHandles array are either a null reference (in Visual Basic Nothing) or are duplicate.

Remarks

The array index of the object that satisfied the wait.

Returns when the wait terminates, either when any of the handles are signaled or when time-out occurred. If more than one object became signaled during the call, this 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. If there are duplicates in the array, the call will fail.

See Also

WaitHandle Class | WaitHandle Members | System.Threading Namespace | WaitHandle.WaitAny Overload List