C# Class Flatwhite.WebApi.AsyncCountdownEvent

Afficher le fichier Open project: vanthoainguyen/Flatwhite Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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
Résultat void

AsyncCountdownEvent() public méthode

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.
Résultat System

Signal() public méthode

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
Résultat void

WaitAsync() public méthode

Asynchronously waits for this event to be set.
public WaitAsync ( ) : Task
Résultat Task