From 028aae6c9c664c4d7182528a6b762b4771a90df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 26 May 2005 12:02:29 +0000 Subject: [PATCH] Another improvement of the debug code - it seems to has a different cause than I thought. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12839 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/smp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/smp.c b/src/system/kernel/smp.c index a6cd13b957..f864ff3d0a 100644 --- a/src/system/kernel/smp.c +++ b/src/system/kernel/smp.c @@ -125,11 +125,13 @@ acquire_spinlock(spinlock *lock) } } else { #if DEBUG_SPINLOCKS + int32 oldValue; if (are_interrupts_enabled()) panic("acquire_spinlock: attempt to acquire lock %p with interrupts enabled\n", lock); - if (atomic_set((int32 *)lock, 1) != 0) { - panic("acquire_spinlock: attempt to acquire lock %p twice on non-SMP system (last caller: %p)\n", - lock, find_lock_caller(lock)); + oldValue = atomic_set((int32 *)lock, 1); + if (oldValue != 0) { + panic("acquire_spinlock: attempt to acquire lock %p twice on non-SMP system (last caller: %p, value %ld)\n", + lock, find_lock_caller(lock), oldValue); } push_lock_caller(arch_get_caller(), lock);