<PackageReference Include="SSH.NET" Version="2020.0.1" />

SemaphoreLight

public class SemaphoreLight : IDisposable
Light implementation of SemaphoreSlim.

Returns a WaitHandle that can be used to wait on the semaphore.

public int CurrentCount { get; }

Gets the current count of the SemaphoreLight.

public SemaphoreLight(int initialCount)

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

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

protected void Dispose(bool disposing)

Releases unmanaged and - optionally - managed resources

public int Release()

Exits the SemaphoreLight once.

public int Release(int releaseCount)

Exits the SemaphoreLight a specified number of times.

public void Wait()

Blocks the current thread until it can enter the SemaphoreLight.

public bool Wait(int millisecondsTimeout)

Blocks the current thread until it can enter the SemaphoreLight, using a 32-bit signed integer that specifies the timeout.

public bool Wait(TimeSpan timeout)

Blocks the current thread until it can enter the SemaphoreLight, using a TimeSpan to specify the timeout.