17 lines
260 B
C
17 lines
260 B
C
#ifndef SPINLOCK_H
|
|
#define SPINLOCK_H
|
|
|
|
#include <stdint.h>
|
|
|
|
// Spinlock
|
|
typedef struct {
|
|
volatile int lock;
|
|
} Spinlock;
|
|
|
|
void spinlock_init(Spinlock *spinlock);
|
|
void spinlock_acquire(Spinlock *spinlock);
|
|
void spinlock_release(Spinlock *spinlock);
|
|
|
|
|
|
#endif
|