![]() |
PIP 5.5.3
Platform-Independent Primitives
|
Fast and full-load lock. More...
#include <pispinlock.h>
Public Member Functions | |
| PISpinlock () | |
| Constructs unlocked spinlock. | |
| ~PISpinlock () | |
| Destroy spinlock. | |
| void | lock () |
| Lock spinlock. More... | |
| void | unlock () |
| Unlock spinlock. More... | |
Fast and full-load lock.
PISpinlock provides critical code section defence between several threads. PISpinlock functionality similar to PIMutex, but working on atomic type and lock() method wait with 100% CPU core load.
For automatic lock-unlock use PISpinlockLocker.
Use this type instead of PIMutex when less waiting time is more important than CPU load!
|
inline |
Lock spinlock.
If spinlock is unlocked it set to locked state and returns immediate. If spinlock is already locked function blocks until spinlock will be unlocked
|
inline |
Unlock spinlock.
In any case this function returns immediate