Struct std::Spinlock
struct Spinlock {
int locked;
}Fields
0 = unlocked, 1 = locked (accessed atomically)
Methods
An unlocked spinlock.
Acquire the lock. Spins until successful.
Try to acquire the lock. Returns 1 on success, 0 if already held.
Release the lock.
Check if the lock is currently held (non-atomic peek).