C# Class Renci.SshNet.Common.CountdownEvent

Represents a synchronization primitive that is signaled when its count reaches zero.
Inheritance: IDisposable
显示文件 Open project: sshnet/SSH.NET

Public Methods

Method 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.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

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

Private Methods

Method Description
EnsureNotDisposed ( ) : void

Method Details

AddCount() public method

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
return void

CountdownEvent() public method

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 .
return System

Dispose() public method

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

Dispose() protected method

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.
return void

Signal() public method

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
return bool

Wait() public method

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.
return bool