|
esp-nimble-cpp 2.6.0
|
A simple spinlock guard for atomic_flag. More...
#include <NimBLEUtils.h>
Public Member Functions | |
| SpinGuard (std::atomic_flag &flag) | |
| Construct a SpinGuard and acquire the lock. | |
| ~SpinGuard () | |
| Destruct a SpinGuard and release the lock. | |
A simple spinlock guard for atomic_flag.
Acquires the lock on construction and releases it on destruction.
|
explicit |
Construct a SpinGuard and acquire the lock.
| [in] | flag | The atomic_flag to guard. |
Spins until the lock is acquired.
| NimBLEUtils::SpinGuard::~SpinGuard | ( | ) |
Destruct a SpinGuard and release the lock.
Releases the lock acquired by the constructor.