Small class to help lock and unlock mutexes. More...
#include <llapr.h>
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. |
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.
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. |