18#ifndef RIPPLE_BASICS_SPINLOCK_H_INCLUDED
19#define RIPPLE_BASICS_SPINLOCK_H_INCLUDED
21#include <xrpl/beast/utility/instrumentation.h>
48 asm volatile(
"yield");
98 "std::atomic<T>::fetch_and(T) and std::atomic<T>::fetch_and(T) are required by packed_spinlock");
122 index >= 0 && (
mask_ != 0),
123 "ripple::packed_spinlock::packed_spinlock : valid index and mask");
195 return lock_.compare_exchange_weak(
Classes to handle arrays of spinlocks packed into a single atomic integer:
packed_spinlock(std::atomic< T > &lock, int index)
A single spinlock packed inside the specified atomic.
packed_spinlock(packed_spinlock const &)=delete
packed_spinlock & operator=(packed_spinlock const &)=delete
A spinlock implemented on top of an atomic integer.
spinlock & operator=(spinlock const &)=delete
spinlock(spinlock const &)=delete
spinlock(std::atomic< T > &lock)
Grabs the.
void spin_pause() noexcept
Inform the processor that we are in a tight spin-wait loop.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.