Share via


WaitAny Method (WaitHandle[], Int32, Boolean)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Waits for any of the elements in the specified array to receive a signal, using a 32-bit signed integer to specify the time interval, and specifying whether to exit the synchronization domain before the wait.

Namespace:  System.Threading
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Shared Function WaitAny ( _
    waitHandles As WaitHandle(), _
    millisecondsTimeout As Integer, _
    exitContext As Boolean _
) As Integer
public static int WaitAny(
    WaitHandle[] waitHandles,
    int millisecondsTimeout,
    bool exitContext
)
public:
static int WaitAny(
    array<WaitHandle^>^ waitHandles, 
    int millisecondsTimeout, 
    bool exitContext
)
static member WaitAny : 
        waitHandles:WaitHandle[] * 
        millisecondsTimeout:int * 
        exitContext:bool -> int 
public static function WaitAny(
    waitHandles : WaitHandle[], 
    millisecondsTimeout : int, 
    exitContext : boolean
) : int

Parameters

  • exitContext
    Type: System. . :: . .Boolean
    true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false.

Return Value

Type: System. . :: . .Int32
The array index of the object that satisfied the wait, or WaitTimeout if no object satisfied the wait and a time interval equivalent to millisecondsTimeout has passed.

.NET Framework Security

See Also

Reference

WaitHandle Class

WaitAny Overload

System.Threading Namespace