![]() |
PIP 5.6.1
Platform-Independent Primitives
|
Scope guard that acquires writer access in constructor and releases it in destructor. More...
#include <pireadwritelock.h>
Public Member Functions | |
| PIWriteLocker (PIReadWriteLock &l, bool condition=true) | |
Constructs and lock for write PIReadWriteLock "l" if "condition" is true. | |
| ~PIWriteLocker () | |
Release write lock on PIReadWriteLock if "condition" was true. | |
Scope guard that acquires writer access in constructor and releases it in destructor.
PIReadWriteLock write autolocker
When a PIWriteLocker object is created, it lock PIReadWriteLock for write, if "condition" true. When control leaves the scope in which the PIWriteLocker object was created, the PIWriteLocker is destructed and unlock for write, if "condition" was true.
If "condition" false this class do nothing.
The PIWriteLocker class is non-copyable.