![]() |
PIP 5.5.3
Platform-Independent Primitives
|
PISpinlock autolocker More...
#include <pispinlock.h>
Public Member Functions | |
| PISpinlockLocker (PISpinlock &s, bool condition=true) | |
Constructs and lock "s" if "condition" is true. | |
| ~PISpinlockLocker () | |
Unlock "s" if "condition" was true. | |
PISpinlock autolocker
When a PISpinlockLocker object is created, it attempts to lock the spinlock it is given, if "condition" true. When control leaves the scope in which the PISpinlockLocker object was created, the PISpinlockLocker is destructed and the spinlock is released, if "condition" true.
If "condition" false this class do nothing.
The PISpinlockLocker class is non-copyable.