SemaphoreSlim Constructor (Int32)
Initializes a new instance of the SemaphoreSlim class, specifying the initial number of requests that can be granted concurrently.
Assembly: mscorlib (in mscorlib.dll)
The initialCount parameter defines the number of concurrent requests to enter the semaphore that can be granted. However, it doesn’t define the maximum number of requests that can be granted concurrently. A SemaphoreSlim object instantiated by calling this constructor doesn’t throw a SemaphoreFullException exception if a call to the Release method increases the value of the CurrentCount property beyond initialCount. This occurs if there are more calls to Release methods than there are to Wait or WaitAsync methods. To set the maximum number of concurrent requests to enter the semaphore that can be granted, call the SemaphoreSlim(Int32, Int32) constructor.
Available since 8
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Available since 8.1