C# Class Indiefreaks.Xna.Threading.SpinLock

A struct which implements a spin lock.
Exibir arquivo Open project: Indiefreaks/igf

Public Methods

Method Description
Enter ( ) : void

Enters the lock. The calling thread will spin wait until it gains ownership of the lock.

Exit ( ) : void

Exits the lock. This allows other threads to take ownership of the lock.

TryEnter ( ) : bool

Tries to enter the lock.

TryEnter ( System.TimeSpan timeout ) : bool

Tries to enter the lock. Fails after the specified time has elapsed without aquiring the lock.

Method Details

Enter() public method

Enters the lock. The calling thread will spin wait until it gains ownership of the lock.
public Enter ( ) : void
return void

Exit() public method

Exits the lock. This allows other threads to take ownership of the lock.
public Exit ( ) : void
return void

TryEnter() public method

Tries to enter the lock.
public TryEnter ( ) : bool
return bool

TryEnter() public method

Tries to enter the lock. Fails after the specified time has elapsed without aquiring the lock.
public TryEnter ( System.TimeSpan timeout ) : bool
timeout System.TimeSpan The timeout.
return bool