From 8c9876eefd4582670984b365e1dcb56f6bea47a1 Mon Sep 17 00:00:00 2001 From: David Leonard Date: Wed, 10 Mar 1999 09:45:41 +0000 Subject: tidy --- lib/libc_r/arch/i386/_atomic_lock.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'lib/libc_r/arch/i386') diff --git a/lib/libc_r/arch/i386/_atomic_lock.c b/lib/libc_r/arch/i386/_atomic_lock.c index 4794226ad3e..bfb7db7e9c8 100644 --- a/lib/libc_r/arch/i386/_atomic_lock.c +++ b/lib/libc_r/arch/i386/_atomic_lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: _atomic_lock.c,v 1.3 1998/12/21 07:58:45 d Exp $ */ +/* $OpenBSD: _atomic_lock.c,v 1.4 1999/03/10 09:45:40 d Exp $ */ /* * Atomic lock for i386 */ @@ -15,13 +15,10 @@ _atomic_lock(volatile _spinlock_lock_t *lock) * a local variable containg the locked state. */ old = _SPINLOCK_LOCKED; - __asm__("xchg %0, %1" - : "=r" (old), "=m" (*lock) : "0"(old), "1" (*lock) ); - /* - * So now LOCKED is in *lock and 'old' contains what - * used to be in *lock. We return 0 if the lock was acquired, - * (ie its old value was UNLOCKED) or 1 otherwise. - */ + __asm__("xchg %0,%1" + : "=r" (old), "=m" (*lock) + : "0" (old), "1" (*lock)); + return (old != _SPINLOCK_UNLOCKED); } -- cgit v1.2.3