C# Class Renci.SshNet.Common.SemaphoreLight

Light implementation of SemaphoreSlim.
显示文件 Open project: sshnet/SSH.NET Class Usage Examples

Public Methods

Method Description
Release ( ) : int

Exits the SemaphoreLight once.

Release ( int releaseCount ) : int

Exits the SemaphoreLight a specified number of times.

SemaphoreLight ( int initialCount ) : System

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

Wait ( ) : void

Blocks the current thread until it can enter the SemaphoreLight.

Method Details

Release() public method

Exits the SemaphoreLight once.
public Release ( ) : int
return int

Release() public method

Exits the SemaphoreLight a specified number of times.
public Release ( int releaseCount ) : int
releaseCount int The number of times to exit the semaphore.
return int

SemaphoreLight() public method

Initializes a new instance of the SemaphoreLight class, specifying the initial number of requests that can be granted concurrently.
is a negative number.
public SemaphoreLight ( int initialCount ) : System
initialCount int The initial number of requests for the semaphore that can be granted concurrently.
return System

Wait() public method

Blocks the current thread until it can enter the SemaphoreLight.
public Wait ( ) : void
return void