|
Pol
Revision:cb584c9
|
#include <spinlock.h>
Public Member Functions | |
| SpinLock () | |
| ~SpinLock () | |
Private Member Functions | |
| void | lock () |
| void | unlock () |
Private Attributes | |
| std::atomic_flag | _lck |
Friends | |
| class | std::lock_guard< SpinLock > |
This is a much faster replacement for mutex when locking very small and fast running protected parts. It is based on a busy loop.
Definition at line 17 of file spinlock.h.
|
inline |
Definition at line 35 of file spinlock.h.
References _lck.
|
inline |
Definition at line 39 of file spinlock.h.
|
inlineprivate |
Puts the caller in an endless busy loop until it acquires the lock
Definition at line 44 of file spinlock.h.
References _lck.
|
inlineprivate |
|
friend |
Definition at line 19 of file spinlock.h.
|
private |
Definition at line 29 of file spinlock.h.
Referenced by lock(), SpinLock(), and unlock().