System.Threading.SemaphoreSlim.Wait Method

Blocks the current thread until it can enter the System.Threading.SemaphoreSlim, using a 32-bit signed integer that specifies the timeout, while observing a System.Threading.CancellationToken.

Syntax

public bool Wait (int millisecondsTimeout, CancellationToken cancellationToken)

Parameters

millisecondsTimeout
The number of milliseconds to wait, or Timeout.Infinite(-1) to wait indefinitely.
cancellationToken
The System.Threading.CancellationToken to observe.

Returns

true if the current thread successfully entered the System.Threading.SemaphoreSlim; otherwise, false.

Remarks

Documentation for this section has not yet been entered.

Requirements

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