Add ARM spinlock
This commit is contained in:
16
os/sync/spinlock.h
Normal file
16
os/sync/spinlock.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user