base::AutoLock< LOCK > Class Template Reference

Automatically lock/unlock a mutex inside a C++ block. More...

#include <base_thread_lock.hh>

Inheritance diagram for base::AutoLock< LOCK >:

base::FastLock::Auto base::RushLock::Auto base::SlowLock::Auto

List of all members.

Public Member Functions

 AutoLock (LOCK *lock)
 ~AutoLock ()

Private Attributes

LOCK * mLock


Detailed Description

template<typename LOCK>
class base::AutoLock< LOCK >

Automatically lock/unlock a mutex inside a C++ block.

Remarks:
UNDERLYING BASIC LOCK MUST BE IN PERSISTENT MEMORY, BUT AUTOLOCK MUST BE ON CALL STACK.
AutoLock is intended to be an automatic variable of a method. AutoLock ensures Lock() and Unlock() are automatically called in a method. Prevents the bug of returning before unlocking.

Constructor & Destructor Documentation

template<typename LOCK>
base::AutoLock< LOCK >::AutoLock ( LOCK *  lock  )  [inline]

template<typename LOCK>
base::AutoLock< LOCK >::~AutoLock (  )  [inline]


Member Data Documentation

template<typename LOCK>
LOCK* base::AutoLock< LOCK >::mLock [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