template<class T>
class xrpl::Spinlock< T >
A spinlock implemented on top of an atomic integer.
- Note
- Using packed_spinlock and spinlock against the same underlying atomic integer can result in spinlock not being able to actually acquire the lock during periods of high contention, because of how the two locks operate: spinlock will spin trying to grab all the bits at once, whereas any given packed_spinlock will only try to grab one bit at a time. Caveat emptor.
This class meets the requirements of Lockable: https://en.cppreference.com/w/cpp/named_req/Lockable
Definition at line 149 of file spinlock.h.