45     class DebugLock : 
public T {
 
   47         DebugLock() : _locked(0) {}
 
   48         void lock()   { T::lock(); _locked = 1; }
 
   49         void unlock() { assert(_locked); _locked = 0; T::unlock(); }
 
   50         bool locked() { 
return _locked != 0; }
 
   68     typedef DebugLock<_Mutex> 
Mutex;
 
   69     typedef DebugLock<_SpinLock> 
SpinLock;
 
AutoLock< Mutex > AutoMutex
AutoLock< SpinLock > AutoSpin
Automatically acquire and release lock within enclosing scope.