11 #define SPINLOCK_FREE 0
13 #define SPINLOCK_BUSY 1
atomic_t spinlock_t
Spinlock structure.
Definition: spinlock.h:16
int spinlock_trylock(spinlock_t *spinlock)
Try to unlock the spinlock.
Definition: spinlock.c:31
void spinlock_init(spinlock_t *spinlock)
Initialize the spinlock.
Definition: spinlock.c:8
void spinlock_lock(spinlock_t *spinlock)
Try to lock the spinlock.
Definition: spinlock.c:13
void spinlock_unlock(spinlock_t *spinlock)
Try to unlock the spinlock.
Definition: spinlock.c:25
volatile unsigned atomic_t
Standard structure for atomic operations (see below for volatile explanation).
Definition: stdatomic.h:12