SAutolock Class Reference
[Utility Classes and Functions]

#include <support/Autolock.h>

List of all members.


Detailed Description

Smart locking class.

This is a convenience class that automatically releases a lock when the class is destroyed. Some synchronization classes supply their own autolockers (for example SLocker::Autolock) that are slightly more efficient. This class works with any synchronization object as lock as it returns lock_status_t from its locking operation.

Example usage:

void MyClass::MySynchronizedMethod()
{
    SAutolock _l(m_lock.Lock());

    ...
}


Public Member Functions

bool IsLocked ()
 SAutolock ()
 SAutolock (const lock_status_t &status)
void SetTo (const lock_status_t &status)
void Unlock ()
 ~SAutolock ()


Constructor & Destructor Documentation

SAutolock const lock_status_t status  )  [inline]
 

SAutolock  )  [inline]
 

~SAutolock  )  [inline]
 


Member Function Documentation

bool IsLocked  )  [inline]
 

void SetTo const lock_status_t status  )  [inline]
 

void Unlock  )  [inline]
 


The documentation for this class was generated from the following file: