C# Class BEPUutilities.SpinLock

Synchronizes using a busy wait. Take care when using this; if the critical section is long or there's any doubt about the use of a busy wait, consider using Monitor locks or other approaches instead. Replaces the .NET SpinLock on PC and provides its functionality on the Xbox360.
Afficher le fichier Open project: Indiefreaks/igf

Méthodes publiques

Méthode Description
Enter ( ) : void

Enters the critical section. A thread cannot attempt to enter the spinlock if it already owns the spinlock.

Exit ( ) : void

Exits the critical section. This can only be safely called from the same thread of execution after a corresponding Enter.

TryEnter ( ) : bool

Attempts to enters the critical section. A thread cannot attempt to enter the spinlock if it already owns the spinlock.

Private Methods

Méthode Description
WaitBriefly ( int &attempt ) : void

Method Details

Enter() public méthode

Enters the critical section. A thread cannot attempt to enter the spinlock if it already owns the spinlock.
public Enter ( ) : void
Résultat void

Exit() public méthode

Exits the critical section. This can only be safely called from the same thread of execution after a corresponding Enter.
public Exit ( ) : void
Résultat void

TryEnter() public méthode

Attempts to enters the critical section. A thread cannot attempt to enter the spinlock if it already owns the spinlock.
public TryEnter ( ) : bool
Résultat bool