C# Class Renci.SshNet.Common.CountdownEvent

Represents a synchronization primitive that is signaled when its count reaches zero.
Inheritance: IDisposable
Afficher le fichier Open project: sshnet/SSH.NET

Méthodes publiques

Méthode Description
AddCount ( ) : void

Increments the CountdownEvent's current count by one.

CountdownEvent ( int initialCount ) : System

Initializes a new instance of CountdownEvent class with the specified count.

If initialCount is zero, the event is created in a signaled state.

Dispose ( ) : void

Releases all resources used by the current instance of the CountdownEvent class.

Signal ( ) : bool

Registers a signal with the CountdownEvent, decrementing the value of CurrentCount.

Wait ( System.TimeSpan timeout ) : bool

Blocks the current thread until the CountdownEvent is set, using a TimeSpan to measure the timeout.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the CountdownEvent, and optionally releases the managed resources.

Private Methods

Méthode Description
EnsureNotDisposed ( ) : void

Method Details

AddCount() public méthode

Increments the CountdownEvent's current count by one.
The current instance has already been disposed. The current instance is already set. is equal to or greather than .
public AddCount ( ) : void
Résultat void

CountdownEvent() public méthode

Initializes a new instance of CountdownEvent class with the specified count.
If initialCount is zero, the event is created in a signaled state.
is less than zero.
public CountdownEvent ( int initialCount ) : System
initialCount int The number of signals initially required to set the .
Résultat System

Dispose() public méthode

Releases all resources used by the current instance of the CountdownEvent class.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Releases the unmanaged resources used by the CountdownEvent, and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
Résultat void

Signal() public méthode

Registers a signal with the CountdownEvent, decrementing the value of CurrentCount.
The current instance has already been disposed. The current instance is already set.
public Signal ( ) : bool
Résultat bool

Wait() public méthode

Blocks the current thread until the CountdownEvent is set, using a TimeSpan to measure the timeout.
The current instance has already been disposed.
public Wait ( System.TimeSpan timeout ) : bool
timeout System.TimeSpan A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely.
Résultat bool