ulib Remove sync

This commit is contained in:
2025-11-23 19:51:48 +01:00
parent 7f78f20b17
commit e105b2fe35
4 changed files with 0 additions and 34 deletions

View File

@ -10,7 +10,6 @@ SRCFILES := $(call GRABSRC, \
string \ string \
system \ system \
printf \ printf \
sync \
args \ args \
util \ util \
ubsan \ ubsan \

View File

@ -1,18 +0,0 @@
#include <stdatomic.h>
#include <sync/spinlock.h>
#define HINT() asm volatile("pause");
void spinlock_init(SpinLock *sl) {
atomic_store(&sl->lock, false);
}
void spinlock_acquire(SpinLock *sl) {
while (atomic_test_and_set_explicit(&sl->lock, memory_order_release)) {
HINT();
}
}
void spinlock_release(SpinLock *sl) {
atomic_clear_flag_explicit(&sl->lock, memory_order_release);
}

View File

@ -1,14 +0,0 @@
#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_

View File

@ -7,7 +7,6 @@
#include <string/stringbuffer.h> #include <string/stringbuffer.h>
#include <string/conv.h> #include <string/conv.h>
#include <string/char.h> #include <string/char.h>
#include <sync/spinlock.h>
#include <syscall/syscall.h> #include <syscall/syscall.h>
#include <system/system.h> #include <system/system.h>
#include <util/util.h> #include <util/util.h>