This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Fix pthread_cond_signal() FUTEX_WAKE_OP fallback
- From: Dinakar Guniguntala <dino at in dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com
- Cc: Ulrich Drepper <drepper at redhat dot com>, Graham Woodward <woodward at uk dot ibm dot com>, Stefan Hajnoczi <stefanha at linux dot vnet dot ibm dot com>, Darren Hart <dvhltc at us dot ibm dot com>
- Date: Tue, 10 Aug 2010 21:32:42 +0530
- Subject: [PATCH] Fix pthread_cond_signal() FUTEX_WAKE_OP fallback
- Reply-to: dino at in dot ibm dot com
futex(FUTEX_WAKE_OP) in pthread_cond_signal no longer defaults to
futex(FUTEX_WAKE) when FUTEX_WAKE_OP fails resulting in this API always
failing. This only affects the x86_32 code.
The following patch fixes the problem.
I have tested this with latest glibc git and it fixes the problem.
make check on a kernel that supports FUTEX_WAKE_OP and on one that
does not both work fine.
2010-08-10 Dinakar Guniguntala <dino@in.ibm.com>
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: If
FUTEX_WAKE_OP fails make sure to call FUTEX_WAKE instead.
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
index 9fc2cbf..43cf663 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
@@ -163,7 +163,6 @@ __pthread_cond_signal:
#endif
orl $FUTEX_WAKE, %ecx
- xorl $(FUTEX_WAKE ^ FUTEX_WAKE_OP), %ecx
movl $SYS_futex, %eax
/* %edx should be 1 already from $FUTEX_WAKE_OP syscall.
movl $1, %edx */