C# Класс 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.
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
WaitBriefly ( int &attempt ) : void

Описание методов

Enter() публичный Метод

Enters the critical section. A thread cannot attempt to enter the spinlock if it already owns the spinlock.
public Enter ( ) : void
Результат void

Exit() публичный Метод

Exits the critical section. This can only be safely called from the same thread of execution after a corresponding Enter.
public Exit ( ) : void
Результат void

TryEnter() публичный Метод

Attempts to enters the critical section. A thread cannot attempt to enter the spinlock if it already owns the spinlock.
public TryEnter ( ) : bool
Результат bool