#ifndef ULIB_SYNC_SPINLOCK_H_
#define ULIB_SYNC_SPINLOCK_H_

#include <stdatomic.h>

typedef struct {
  atomic_bool lock;
} SpinLock;

void spinlock_init(SpinLock *sl);
void spinlock_acquire(SpinLock *sl);
void spinlock_release(SpinLock *sl);

#endif // ULIB_SYNC_SPINLOCK_H_
