#include <llapr.h>
Public Member Functions | |
LLScopedLock (apr_thread_mutex_t *mutex) | |
Constructor which accepts a mutex, and locks it. | |
~LLScopedLock () | |
Destructor which unlocks the mutex if still locked. | |
bool | isLocked () const |
Check lock. | |
void | unlock () |
This method unlocks the mutex. | |
Protected Attributes | |
bool | mLocked |
apr_thread_mutex_t * | mMutex |
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.
Definition at line 72 of file llapr.h.
LLScopedLock::LLScopedLock | ( | apr_thread_mutex_t * | mutex | ) |
Constructor which accepts a mutex, and locks it.
mutex | An allocated APR mutex. If you pass in NULL, this wrapper will not lock. |
Definition at line 78 of file llapr.cpp.
References ll_apr_warn_status(), mLocked, and mMutex.
LLScopedLock::~LLScopedLock | ( | ) |
bool LLScopedLock::isLocked | ( | ) | const [inline] |
void LLScopedLock::unlock | ( | ) |
This method unlocks the mutex.
Definition at line 102 of file llapr.cpp.
References ll_apr_warn_status(), mLocked, and mMutex.
Referenced by ~LLScopedLock().
bool LLScopedLock::mLocked [protected] |
apr_thread_mutex_t* LLScopedLock::mMutex [protected] |