From f48e74bebe7fe33b0a86952a08c59eba8f65273e Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Thu, 26 Jun 2025 06:19:58 +0200 Subject: [PATCH] Cosmetic fixes in spinlock --- lib/spinlock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/spinlock.c b/lib/spinlock.c index 3f3e0d7..595432e 100644 --- a/lib/spinlock.c +++ b/lib/spinlock.c @@ -58,8 +58,8 @@ void acquire(struct spinlock *lk) { panic("acquire"); // Spin until aquired. See file header for details - while (__sync_lock_test_and_set(&lk->locked, 1) != 0) { - } + while (__sync_lock_test_and_set(&lk->locked, 1) != 0); + __sync_synchronize(); // No loads/stores after this point // Record info about lock acquisition for holding() and debugging.