diff --git a/src/system/kernel/smp.cpp b/src/system/kernel/smp.cpp index 4c4b357f68..a5a4b26e9f 100644 --- a/src/system/kernel/smp.cpp +++ b/src/system/kernel/smp.cpp @@ -637,7 +637,7 @@ acquire_read_spinlock(rw_spinlock* lock) if (try_acquire_read_spinlock(lock)) break; - while (atomic_get(&lock->lock) != 0) { + while ((atomic_get(&lock->lock) & (1u << 31)) != 0) { if (++count == SPINLOCK_DEADLOCK_COUNT) { panic("acquire_read_spinlock(): Failed to acquire spinlock %p " "for a long time!", lock);