SemaphoreSlim Constructor (Int32)

Task Parallel System.Threading

Initializes a new instance of the SemaphoreSlim class, specifying the initial number of requests that can be granted concurrently.

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

Syntax

Visual Basic (Declaration)
Public Sub New ( _
	initialCount As Integer _
)
C#
public SemaphoreSlim(
	int initialCount
)

Parameters

initialCount
Type: System..::.Int32
The initial number of requests for the semaphore that can be granted concurrently.

Exceptions

ExceptionCondition
System..::.ArgumentOutOfRangeExceptioninitialCount is less than 0.

See Also