Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXSpinLock Class Reference

FXSpinLock can be used to provide safe access to very small critical sections. More...

#include <FXThread.h>

List of all members.

Public Member Functions

 FXSpinLock ()
void lock ()
FXbool trylock ()
FXbool locked ()
void unlock ()
 ~FXSpinLock ()


Detailed Description

FXSpinLock can be used to provide safe access to very small critical sections.

It is cheaper than FXMutex, but unlike FXMutex, threads which are unable to obtain the lock will not block, but spin in a tight loop until the lock can be obtained.


Constructor & Destructor Documentation

FX::FXSpinLock::FXSpinLock (  ) 

Initialize the spinlock.

FX::FXSpinLock::~FXSpinLock (  ) 

Delete the spinlock.


Member Function Documentation

void FX::FXSpinLock::lock (  ) 

Lock the mutex.

FXbool FX::FXSpinLock::trylock (  ) 

Return true if succeeded locking the spinlock.

FXbool FX::FXSpinLock::locked (  ) 

Return true if spinlock is already locked.

void FX::FXSpinLock::unlock (  ) 

Unlock spinlock.

Copyright © 1997-2009 Jeroen van der Zijp