#include <pcriticalsection.h>
Public Member Functions | |
| Lock (CriticalSection &cs) | |
| ~Lock () | |
| Lock & | operator= (CriticalSection &cs) |
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 CriticalSection will be unlocked. The following example shows how to use the Lock guard:
class X { void a(int val); private: CriticalSection cs; int var; } void X::a(int val) { CriticalSection::Lock l(cs); var = val; }
Definition at line 81 of file pcriticalsection.h.
|
|
Definition at line 83 of file pcriticalsection.h. |
|
|
Definition at line 86 of file pcriticalsection.h. |
|
|
Definition at line 89 of file pcriticalsection.h. References P::CriticalSection::lock(). |
1.3.3