Manages locking and unlocking of a mutes. More...
#include <ScopedMutexLock.h>
Public Member Functions | |
bool | isLocked () const |
operator bool () const | |
ScopedMutexLock (Mutex &mutex, bool force=true) | |
~ScopedMutexLock () | |
Private Attributes | |
bool | m_is_locked |
Mutex & | m_mutex |
Additional Inherited Members | |
Protected Member Functions inherited from icl_core::Noncopyable | |
Noncopyable () | |
virtual | ~Noncopyable () |
Manages locking and unlocking of a mutes.
Locks or tries to lock a mutex in the constructor and unlocks it in the destructor.
Definition at line 50 of file ScopedMutexLock.h.
|
explicit |
Locks the mutex.
mutex | The mutex to use. |
force | Ensure at all cost that IsLocked() is true . |
Definition at line 30 of file ScopedMutexLock.cpp.
icl_core::thread::ScopedMutexLock::~ScopedMutexLock | ( | ) |
Unlocks the mutex.
Definition at line 40 of file ScopedMutexLock.cpp.
|
inline |
Check if the mutex has been successfully locked.
Definition at line 64 of file ScopedMutexLock.h.
|
inline |
Implicit conversion to bool.
Definition at line 68 of file ScopedMutexLock.h.
|
private |
Definition at line 83 of file ScopedMutexLock.h.
|
private |
Definition at line 82 of file ScopedMutexLock.h.