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