C# Class Subtext.Framework.Threading.Semaphore

Implementation of Dijkstra's PV Semaphore based on the Monitor class.
Afficher le fichier Open project: ayende/Subtext

Méthodes publiques

Méthode Description
AddOne ( ) : void

V the semaphore (add 1 unit to it).

P ( ) : void

P the semaphore (take out 1 unit from it).

Reset ( int count ) : void

Resets the semaphore to the specified count. Should be used cautiously.

Semaphore ( ) : System

Initialize the semaphore as a binary semaphore.

Semaphore ( int count ) : System

Initialize the semaphore as a counting semaphore.

V ( ) : void

V the semaphore (add 1 unit to it).

WaitOne ( ) : void

P the semaphore (take out 1 unit from it).

Method Details

AddOne() public méthode

V the semaphore (add 1 unit to it).
public AddOne ( ) : void
Résultat void

P() public méthode

P the semaphore (take out 1 unit from it).
public P ( ) : void
Résultat void

Reset() public méthode

Resets the semaphore to the specified count. Should be used cautiously.
public Reset ( int count ) : void
count int
Résultat void

Semaphore() public méthode

Initialize the semaphore as a binary semaphore.
public Semaphore ( ) : System
Résultat System

Semaphore() public méthode

Initialize the semaphore as a counting semaphore.
Throws if the count argument is less than 1.
public Semaphore ( int count ) : System
count int Initial number of threads that can take out units from this semaphore.
Résultat System

V() public méthode

V the semaphore (add 1 unit to it).
public V ( ) : void
Résultat void

WaitOne() public méthode

P the semaphore (take out 1 unit from it).
public WaitOne ( ) : void
Résultat void