From e408880b8102768b2fb612a82589a143b04d6302 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 23 Mar 2004 10:01:06 +0000 Subject: Update. 2004-03-23 Ulrich Drepper * sysdeps/ia64/pt-machine.h (BUSY_WAIT_NOP): Define. * sysdeps/x86_64/pt-machine.h (BUSY_WAIT_NOP): Likewise. --- nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'nptl/sysdeps/unix/sysv/linux') diff --git a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h index 9f089f8e6e..a9823d8d4b 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h @@ -102,8 +102,13 @@ extern int __lll_mutex_unlock_wake (int *__futex) __attribute ((regparm (1))) attribute_hidden; +/* NB: in the lll_mutex_trylock macro we simply return the value in %eax + after the cmpxchg instruction. In case the operation succeded this + value is zero. In case the operation failed, the cmpxchg instruction + has loaded the current value of the memory work which is guaranteed + to be nonzero. */ #define lll_mutex_trylock(futex) \ - ({ unsigned char ret; \ + ({ int ret; \ __asm __volatile (LOCK_INSTR "cmpxchgl %2, %1" \ : "=a" (ret), "=m" (futex) \ : "r" (LLL_MUTEX_LOCK_INITIALIZER_LOCKED), "m" (futex),\ -- cgit 1.4.1