summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-05-15 06:24:31 +0000
committerUlrich Drepper <drepper@redhat.com>2007-05-15 06:24:31 +0000
commit83d87915da34fc02d170ff8c356406040da2823f (patch)
tree7d76dcc1f12bd5dd7d65b329a3cd37422be12a82 /nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
parent1d47e92f71c36165364c8807e52d0d0dc0f66142 (diff)
* sysdeps/unix/sysv/linux/sem_post.c: Only wake threads if old
value of semaphore was zero. * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise. * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary extra cancellation test. * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S9
1 files changed, 6 insertions, 3 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
index 7f608a5974..cc3a9a9cee 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -41,15 +41,18 @@ sem_post:
LOCK
xaddl %edx, (%rdi)
+ testl %edx, %edx
+ jne 2f
+
movl $SYS_futex, %eax
movl $FUTEX_WAKE, %esi
- incl %edx
+ movl $1, %edx
syscall
testq %rax, %rax
js 1f
- xorl %eax, %eax
+2: xorl %eax, %eax
retq
1: