Επεξεργασία

Κοινή χρήση μέσω


SemaphoreSlim.Release Method

Definition

Releases the SemaphoreSlim object.

Overloads

Release()

Releases the SemaphoreSlim object once.

Release(Int32)

Releases the SemaphoreSlim object a specified number of times.

Release()

Source:
SemaphoreSlim.cs
Source:
SemaphoreSlim.cs
Source:
SemaphoreSlim.cs

Releases the SemaphoreSlim object once.

public:
 int Release();
public int Release ();
member this.Release : unit -> int
Public Function Release () As Integer

Returns

The previous count of the SemaphoreSlim.

Exceptions

The current instance has already been disposed.

The SemaphoreSlim has already reached its maximum size.

Remarks

A call to the Release() method increments the CurrentCount property by one. If the value of the CurrentCount property is zero before this method is called, the method also allows one thread or task blocked by a call to the Wait or WaitAsync method to enter the semaphore.

See also

Applies to

Release(Int32)

Source:
SemaphoreSlim.cs
Source:
SemaphoreSlim.cs
Source:
SemaphoreSlim.cs

Releases the SemaphoreSlim object a specified number of times.

public:
 int Release(int releaseCount);
public int Release (int releaseCount);
member this.Release : int -> int
Public Function Release (releaseCount As Integer) As Integer

Parameters

releaseCount
Int32

The number of times to exit the semaphore.

Returns

The previous count of the SemaphoreSlim.

Exceptions

The current instance has already been disposed.

releaseCount is less than 1.

The SemaphoreSlim has already reached its maximum size.

Remarks

A call to the Release(Int32) method increments the CurrentCount property by releaseCount. If the value of the CurrentCount property is zero before this method is called, the method also allows releaseCount threads or tasks blocked by a call to the Wait or WaitAsync method to enter the semaphore.

See also

Applies to