#ifndef SPINLOCK_SPINLOCK_H_
#define SPINLOCK_SPINLOCK_H_

#include <stdatomic.h>
#include <stdint.h>

typedef struct {
  atomic_bool lock;
} SpinLock;

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

#endif // SPINLOCK_SPINLOCK_H_
