SemaphoreSlim.Release Method (Int32)

May 11, 2014

Exits the SemaphoreSlim a specified number of times.

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

public int Release(
	int releaseCount
)

Parameters

releaseCount
Type: System.Int32
The number of times to exit the semaphore.

Return Value

Type: System.Int32
The previous count of the SemaphoreSlim.

ExceptionCondition
ObjectDisposedException

The current instance has already been disposed.

ArgumentOutOfRangeException

releaseCount is less than 1.

SemaphoreFullException

The SemaphoreSlim has already reached its maximum size.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2014 Microsoft