base::FastLock Class Reference

FastLock is a recursive spinlock. More...

#include <base_thread_lock.hh>

Inheritance diagram for base::FastLock:

base::Atomic

List of all members.

Public Member Functions

 FastLock (void)
 ~FastLock ()
void Lock (void)
 Acquire recursive lock.
void Unlock (void)
 Release recursive lock.
bool IfLocked (void)

Private Types

enum  { UNLOCKED, LOCKED, BUSY }

Private Attributes

volatile Atomic::Int mLock
volatile Atomic::Int mDepth
volatile
Thread::AtomicTid 
mOwner

Classes

class  Auto


Detailed Description

FastLock is a recursive spinlock.

Remarks:
PLACE IN PERSISTENT MEMORY (NOT CALL STACK).
Ironically, the lock's data itself must be locked. FastLock locks itself using the additional lock state BUSY. BUSY means another thread is executing inside FastLock.

Member Enumeration Documentation

anonymous enum [private]

Enumerator:
UNLOCKED 
LOCKED 
BUSY 


Constructor & Destructor Documentation

base::FastLock::FastLock ( void   )  [inline]

base::FastLock::~FastLock (  )  [inline]


Member Function Documentation

void base::FastLock::Lock ( void   )  [inline]

Acquire recursive lock.

void base::FastLock::Unlock ( void   )  [inline]

Release recursive lock.

bool base::FastLock::IfLocked ( void   )  [inline]

Returns:
True if THIS THREAD DOES NOT OWN the lock, else false. Returns false if thread owns a lock since a thread shouldn't block itself!


Member Data Documentation

volatile Atomic::Int base::FastLock::mLock [private]

volatile Atomic::Int base::FastLock::mDepth [private]

volatile Thread::AtomicTid base::FastLock::mOwner [private]


The documentation for this class was generated from the following file: Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:19 2007