PIP 5.5.3
Platform-Independent Primitives
Public Member Functions | List of all members
PISpinlockLocker Class Reference

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.
 

Detailed Description

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.