feat: Symmetric Multiprocessing, text editor improvements, merge doom libc, implement math functions

This commit is contained in:
2026-03-23 20:09:11 +01:00
parent a805b06406
commit 63d9270613
46 changed files with 3004 additions and 2404 deletions
+16
View File
@@ -15,4 +15,20 @@ namespace kcp {
void Acquire();
void Release();
};
// Non-interrupt-disabling mutex for subsystems that are only called
// from process/syscall context (never from interrupt handlers).
// Keeps interrupts enabled while spinning and while held.
class Mutex {
std::atomic_flag flag{ATOMIC_FLAG_INIT};
public:
void Acquire() {
while (flag.test_and_set(std::memory_order_acquire)) {
asm volatile("pause");
}
}
void Release() {
flag.clear(std::memory_order_release);
}
};
};