ScopeLock Class Reference

#include <dthread.h>

Public Member Functions

 ScopeLock (Mutex &m_)
 ScopeLock (CondVar &c_)
void unlock ()
bool isLocked ()
 ~ScopeLock ()

Private Attributes

Mutexm
CondVarc

Detailed Description

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.


Constructor & Destructor Documentation

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().

ScopeLock::~ScopeLock (  )  [inline]

Definition at line 159 of file dthread.h.

References unlock().


Member Function Documentation

bool ScopeLock::isLocked (  )  [inline]

Definition at line 155 of file dthread.h.

References c, and m.

void ScopeLock::unlock (  )  [inline]

Definition at line 144 of file dthread.h.

References c, m, CondVar::unlock(), and Mutex::unlock().

Referenced by ~ScopeLock().


Field Documentation

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().


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1