aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-03-23 10:01:06 +0000
committerUlrich Drepper <drepper@redhat.com>2004-03-23 10:01:06 +0000
commite408880b8102768b2fb612a82589a143b04d6302 (patch)
treed26a78a852532cd39bf83212f025a2a5b7659dc5 /nptl
parent16b06b70b58461cca36a4aa83559cb89385076ce (diff)
downloadglibc-e408880b8102768b2fb612a82589a143b04d6302.zip
glibc-e408880b8102768b2fb612a82589a143b04d6302.tar.gz
glibc-e408880b8102768b2fb612a82589a143b04d6302.tar.bz2
Update.
2004-03-23 Ulrich Drepper <drepper@redhat.com> * sysdeps/ia64/pt-machine.h (BUSY_WAIT_NOP): Define. * sysdeps/x86_64/pt-machine.h (BUSY_WAIT_NOP): Likewise.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog3
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h7
2 files changed, 9 insertions, 1 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index e0439e1..5155b79 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,6 +1,9 @@
2004-03-23 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
+ No need to restrict type of ret. Make it int. Add comment.
+
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
Remove unnecessary setne instruction.
2004-03-22 Jakub Jelinek <jakub@redhat.com>
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
index 9f089f8..a9823d8 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),\