SpinLock.h 233 B

1234567891011121314
  1. #ifndef CORE_SPIN_LOCK_H
  2. #define CORE_SPIN_LOCK_H
  3. #include <stdatomic.h>
  4. typedef struct {
  5. atomic_bool lock;
  6. } SpinLock;
  7. void initSpinLock(SpinLock* l);
  8. void lockSpinLock(SpinLock* l);
  9. void unlockSpinLock(SpinLock* l);
  10. #endif