Jamba C++ API
6.2.0
|
A simple implementation of a spin lock using the std::atomic_flag which is guaranteed to be atomic and lock free. More...
#include <SpinLock.h>
Classes | |
class | Lock |
Public Member Functions | |
Lock | acquire () |
SpinLock & | operator= (SpinLock const &)=delete |
SpinLock () | |
SpinLock (SpinLock const &)=delete | |
Private Member Functions | |
void | unlock () |
Private Attributes | |
std::atomic_flag | fFlag |
Friends | |
class | Lock |
A simple implementation of a spin lock using the std::atomic_flag which is guaranteed to be atomic and lock free.
The usage is the following:
auto lock = spinLock.acquire(); ...
the lock is released automatically when it exits the scope.
|
inline |
|
inline |
|
inlineprivate |
|
friend |
|
private |