#include <prwlock.h>
Public Member Functions | |
| WriteLock (RWLock &lock) | |
| ~WriteLock () | |
| WriteLock & | 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; } void X::set(int val) { RWLock::WriteLock l(rwl); var = val; }
Definition at line 183 of file prwlock.h.
|
|
|
|
|
|
|
|
Definition at line 191 of file prwlock.h. References P::RWLock::writeLock(). |
1.3.3