63 #ifndef prof_lean_spinlock_h 64 #define prof_lean_spinlock_h 80 #define SPINLOCK_UNLOCKED_VALUE (-1L) 81 #define SPINLOCK_LOCKED_VALUE (1L) 82 #define INITIALIZE_SPINLOCK(x) { .thelock = ATOMIC_VAR_INIT(x) } 84 #define SPINLOCK_UNLOCKED INITIALIZE_SPINLOCK(SPINLOCK_UNLOCKED_VALUE) 85 #define SPINLOCK_LOCKED INITIALIZE_SPINLOCK(SPINLOCK_LOCKED_VALUE) 142 while (limit-- > 0 &&
147 return (limit + 1 > 0);
168 if (old_lockval == locked_val)
197 while (limit-- > 0 &&
202 if (old_lockval == locked_val)
206 return (limit + 1 > 0);
208 #endif // prof_lean_spinlock_h
static void spinlock_init(spinlock_t *l)
static bool hwt_limit_spinlock_lock(spinlock_t *l, size_t limit, long locked_val)
#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure)
static void spinlock_unlock(spinlock_t *l)
static bool limit_spinlock_lock(spinlock_t *l, size_t limit, long locked_val)
#define atomic_load_explicit(object, order)
#define atomic_store_explicit(object, desired, order)
#define SPINLOCK_LOCKED_VALUE
#define atomic_init(obj, value)
static void spinlock_lock(spinlock_t *l)
static bool hwt_cas_spinlock_lock(spinlock_t *l, size_t limit, long locked_val)
struct spinlock_s spinlock_t
#define SPINLOCK_UNLOCKED_VALUE
static bool spinlock_is_locked(spinlock_t *l)