This commit is contained in:
2026-10-06 01:34:24 +02:00
parent 134343d2a8
commit f8eb4f4e54
28 changed files with 166 additions and 36 deletions
+5
View File
@@ -1,6 +1,11 @@
#include <zinnia/spin.h>
#include <stdatomic.h>
void spin_init(struct spinlock* spin) {
spin->next = 0;
spin->owner = 0;
}
void spin_lock(struct spinlock* spin) {
uint32_t my = atomic_fetch_add_explicit(&spin->next, 1, memory_order_relaxed);