C# Class Flatwhite.WebApi.AsyncCountdownEvent

Mostra file Open project: vanthoainguyen/Flatwhite Class Usage Examples

Public Methods

Method Description
AddCount ( ) : void

Attempts to add one to the current count. This method throws InvalidOperationException if the count is already at zero or if the new count would be greater than Int32.MaxValue.

AsyncCountdownEvent ( int count ) : System

Creates an async-compatible countdown event.

Signal ( ) : void

Attempts to subtract one from the current count. This method throws InvalidOperationException if the count is already at zero or if the new count would be less than zero.

WaitAsync ( ) : Task

Asynchronously waits for this event to be set.

Private Methods

Method Description
ModifyCount ( int signalCount ) : void

Attempts to modify the current count by the specified amount. This method returns false if the new current count value would be invalid, or if the count has already reached zero.

Method Details

AddCount() public method

Attempts to add one to the current count. This method throws InvalidOperationException if the count is already at zero or if the new count would be greater than Int32.MaxValue.
public AddCount ( ) : void
return void

AsyncCountdownEvent() public method

Creates an async-compatible countdown event.
public AsyncCountdownEvent ( int count ) : System
count int The number of signals this event will need before it becomes set. Must be greater than zero.
return System

Signal() public method

Attempts to subtract one from the current count. This method throws InvalidOperationException if the count is already at zero or if the new count would be less than zero.
public Signal ( ) : void
return void

WaitAsync() public method

Asynchronously waits for this event to be set.
public WaitAsync ( ) : Task
return Task