#include <prwlock.h>
Public Member Functions | |
| ReadLock (RWLock &lock) | |
| ~ReadLock () | |
| ReadLock & | operator= (RWLock &mutex) |
The lock guard class is used to do exception-safe locking. Simply put a Lock object on the Stack. When the stack-frame is unwinded (by a throw, or a return) the RWLock will be unlocked. The following example shows how to use the Lock guard:
class X { void set(int val); int get(); private: RWLock rwl; int var; } int X::get() { RWLock::ReadLock l(rwl); return var; }
Definition at line 136 of file prwlock.h.
|
|
|
|
|
|
|
|
Definition at line 144 of file prwlock.h. References P::RWLock::readLock(). |
1.3.3