SemaphoreSlim Constructor (Int32, Int32)
Collapse the table of content
Expand the table of content

SemaphoreSlim Constructor (Int32, Int32)

.NET Framework (current version)
 

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

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

Public Sub New (
	initialCount As Integer,
	maxCount As Integer
)

Parameters

initialCount
Type: System.Int32

The initial number of requests for the semaphore that can be granted concurrently.

maxCount
Type: System.Int32

The maximum number of requests for the semaphore that can be granted concurrently.

Exception Condition
ArgumentOutOfRangeException

initialCount is less than 0, or initialCount is greater than maxCount, or maxCount is equal to or less than 0.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft