Userspace dlmalloc port, supporting syscalls mman_map()/mman_unmap()
This commit is contained in:
14
ulib/sync/spinlock.h
Normal file
14
ulib/sync/spinlock.h
Normal file
@ -0,0 +1,14 @@
|
||||
#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_
|
||||
Reference in New Issue
Block a user