System.Threading.SynchronizationContext.Wait Method

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

Syntax

[System.CLSCompliant(false)]
[System.Runtime.ConstrainedExecution.PrePrepareMethod]
public virtual int Wait (IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout)

Parameters

waitHandles
An array of type IntPtr that contains the native operating system handles.
waitAll
true to wait for all handles; false to wait for any handle.
millisecondsTimeout
The number of milliseconds to wait, or Timeout.Infinite (-1) to wait indefinitely.

Returns

The array index of the object that satisfied the wait.

Remarks

The SynchronizationContext.Wait(IntPtr[], bool, int) method calls the external declaration SynchronizationContext.WaitHelper(IntPtr[], bool, int) to perform the wait activity. Override the SynchronizationContext.Wait(IntPtr[], bool, int) method to change the wait behavior for the synchronization context.

Requirements

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0