Made to Order Software Corporation Logo

LLChatLib: LLScopedLock Class Reference

LLScopedLock Class Reference

Small class to help lock and unlock mutexes. More...

#include <llapr.h>

List of all members.

Public Member Functions

bool isLocked () const
 Check lock.

 LLScopedLock (apr_thread_mutex_t *mutex)
 Constructor which accepts a mutex, and locks it.

void unlock ()
 This method unlocks the mutex.

 ~LLScopedLock ()
 Destructor which unlocks the mutex if still locked.


Detailed Description

Small class to help lock and unlock mutexes.

This class is used to have a stack level lock once you already have an apr mutex handy. The constructor handles the lock, and the destructor handles the unlock. Instances of this class are not thread safe.


Constructor & Destructor Documentation

LLScopedLock::LLScopedLock ( apr_thread_mutex_t *  mutex  ) 

Constructor which accepts a mutex, and locks it.

Parameters:
mutex An allocated APR mutex. If you pass in NULL, this wrapper will not lock.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
  • /home/doug/src/oss/slitechat/trunk/LLChatLib/llcommon/llapr.h
  • /home/doug/src/oss/slitechat/trunk/LLChatLib/llcommon/llapr.cpp
Generated on Thu Sep 23 17:18:44 2010 for LLChatLib by  doxygen 1.6.3