ManualResetEventSlim.Wait ManualResetEventSlim.Wait ManualResetEventSlim.Wait ManualResetEventSlim.Wait Method

Definition

Blocks the current thread until the current ManualResetEventSlim is set.

Overloads

Wait() Wait() Wait() Wait()

Blocks the current thread until the current ManualResetEventSlim is set.

Wait(Int32) Wait(Int32) Wait(Int32) Wait(Int32)

Blocks the current thread until the current ManualResetEventSlim is set, using a 32-bit signed integer to measure the time interval.

Wait(CancellationToken) Wait(CancellationToken) Wait(CancellationToken)

Blocks the current thread until the current ManualResetEventSlim receives a signal, while observing a CancellationToken.

Wait(TimeSpan) Wait(TimeSpan) Wait(TimeSpan) Wait(TimeSpan)

Blocks the current thread until the current ManualResetEventSlim is set, using a TimeSpan to measure the time interval.

Wait(Int32, CancellationToken) Wait(Int32, CancellationToken) Wait(Int32, CancellationToken)

Blocks the current thread until the current ManualResetEventSlim is set, using a 32-bit signed integer to measure the time interval, while observing a CancellationToken.

Wait(TimeSpan, CancellationToken) Wait(TimeSpan, CancellationToken) Wait(TimeSpan, CancellationToken)

Blocks the current thread until the current ManualResetEventSlim is set, using a TimeSpan to measure the time interval, while observing a CancellationToken.

Wait() Wait() Wait() Wait()

Blocks the current thread until the current ManualResetEventSlim is set.

public:
 void Wait();
public void Wait ();
member this.Wait : unit -> unit
Public Sub Wait ()

Exceptions

Remarks

The caller of this method blocks indefinitely until the current instance is set. The caller will return immediately if the event is currently in a set state.

See also

Wait(Int32) Wait(Int32) Wait(Int32) Wait(Int32)

Blocks the current thread until the current ManualResetEventSlim is set, using a 32-bit signed integer to measure the time interval.

public:
 bool Wait(int millisecondsTimeout);
public bool Wait (int millisecondsTimeout);
member this.Wait : int -> bool
Public Function Wait (millisecondsTimeout As Integer) As Boolean

Parameters

millisecondsTimeout
Int32 Int32 Int32 Int32

The number of milliseconds to wait, or Infinite(-1) to wait indefinitely.

Returns

true if the ManualResetEventSlim was set; otherwise, false.

Exceptions

millisecondsTimeout is a negative number other than -1, which represents an infinite time-out.

See also

Wait(CancellationToken) Wait(CancellationToken) Wait(CancellationToken)

Blocks the current thread until the current ManualResetEventSlim receives a signal, while observing a CancellationToken.

public:
 void Wait(System::Threading::CancellationToken cancellationToken);
public void Wait (System.Threading.CancellationToken cancellationToken);
member this.Wait : System.Threading.CancellationToken -> unit

Parameters

Exceptions

The object has already been disposed or the CancellationTokenSource that created cancellationToken has been disposed.

System.OperationCanceledExcepton System.OperationCanceledExcepton System.OperationCanceledExcepton System.OperationCanceledExcepton

cancellationToken was canceled.

Remarks

The caller of this method blocks indefinitely until the current instance is set. The caller will return immediately if the event is currently in a set state.

See also

Wait(TimeSpan) Wait(TimeSpan) Wait(TimeSpan) Wait(TimeSpan)

Blocks the current thread until the current ManualResetEventSlim is set, using a TimeSpan to measure the time interval.

public:
 bool Wait(TimeSpan timeout);
public bool Wait (TimeSpan timeout);
member this.Wait : TimeSpan -> bool
Public Function Wait (timeout As TimeSpan) As Boolean

Parameters

timeout
TimeSpan TimeSpan TimeSpan TimeSpan

A TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.

Returns

true if the ManualResetEventSlim was set; otherwise, false.

Exceptions

timeout is a negative number other than -1 milliseconds, which represents an infinite time-out.

-or-

The number of milliseconds in timeout is greater than MaxValue.

See also

Wait(Int32, CancellationToken) Wait(Int32, CancellationToken) Wait(Int32, CancellationToken)

Blocks the current thread until the current ManualResetEventSlim is set, using a 32-bit signed integer to measure the time interval, while observing a CancellationToken.

public:
 bool Wait(int millisecondsTimeout, System::Threading::CancellationToken cancellationToken);
public bool Wait (int millisecondsTimeout, System.Threading.CancellationToken cancellationToken);
member this.Wait : int * System.Threading.CancellationToken -> bool

Parameters

millisecondsTimeout
Int32 Int32 Int32 Int32

The number of milliseconds to wait, or Infinite(-1) to wait indefinitely.

Returns

true if the ManualResetEventSlim was set; otherwise, false.

Exceptions

millisecondsTimeout is a negative number other than -1, which represents an infinite time-out.

The object has already been disposed or the CancellationTokenSource that created cancellationToken has been disposed.

System.Threading.OperationCanceledException System.Threading.OperationCanceledException System.Threading.OperationCanceledException System.Threading.OperationCanceledException

cancellationToken was canceled.

See also

Wait(TimeSpan, CancellationToken) Wait(TimeSpan, CancellationToken) Wait(TimeSpan, CancellationToken)

Blocks the current thread until the current ManualResetEventSlim is set, using a TimeSpan to measure the time interval, while observing a CancellationToken.

public:
 bool Wait(TimeSpan timeout, System::Threading::CancellationToken cancellationToken);
public bool Wait (TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
member this.Wait : TimeSpan * System.Threading.CancellationToken -> bool

Parameters

timeout
TimeSpan TimeSpan TimeSpan TimeSpan

A TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.

Returns

true if the ManualResetEventSlim was set; otherwise, false.

Exceptions

timeout is a negative number other than -1 milliseconds, which represents an infinite time-out.

-or-

The number of milliseconds in timeout is greater than MaxValue.

The object has already been disposed or the CancellationTokenSource that created cancellationToken has been disposed.

System.Threading.OperationCanceledException System.Threading.OperationCanceledException System.Threading.OperationCanceledException System.Threading.OperationCanceledException

cancellationToken was canceled.

See also

Applies to