#include <dthread.h>
Public Member Functions | |
| ScopeLock (Mutex &m_) | |
| ScopeLock (CondVar &c_) | |
| void | unlock () |
| bool | isLocked () |
| ~ScopeLock () | |
Private Attributes | |
| Mutex * | m |
| CondVar * | c |
Construct a version of this class as a local variable, and it will hold its lock as long as it's in scope. Thus you can get auto-unlock upon return.
Definition at line 123 of file dthread.h.
| ScopeLock::ScopeLock | ( | Mutex & | m_ | ) | [inline] |
Definition at line 128 of file dthread.h.
References Mutex::lock(), and m.
| ScopeLock::ScopeLock | ( | CondVar & | c_ | ) | [inline] |
Definition at line 136 of file dthread.h.
References c, and CondVar::lock().
| bool ScopeLock::isLocked | ( | ) | [inline] |
| void ScopeLock::unlock | ( | ) | [inline] |
Definition at line 144 of file dthread.h.
References c, m, CondVar::unlock(), and Mutex::unlock().
Referenced by ~ScopeLock().
CondVar* ScopeLock::c [private] |
Definition at line 126 of file dthread.h.
Referenced by isLocked(), ScopeLock(), and unlock().
Mutex* ScopeLock::m [private] |
Definition at line 125 of file dthread.h.
Referenced by isLocked(), ScopeLock(), and unlock().
1.6.1