fix: new spinlock implementation, ramdisk max files, wallpaper scan locations

This commit is contained in:
2026-03-22 10:40:35 +01:00
parent 1a9fc0724c
commit bc52bd5efc
7 changed files with 41 additions and 7 deletions
+5
View File
@@ -8,12 +8,17 @@
namespace kcp {
void Spinlock::Acquire() {
uint64_t flags;
asm volatile("pushfq; pop %0; cli" : "=r"(flags) :: "memory");
while (atomic_flag.test_and_set(std::memory_order_acquire)) {
asm volatile("pause");
}
savedFlags = flags;
}
void Spinlock::Release() {
uint64_t flags = savedFlags;
atomic_flag.clear(std::memory_order_release);
asm volatile("push %0; popfq" :: "r"(flags) : "memory");
}
};