This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix pthread_cond_signal() FUTEX_WAKE_OP fallback



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  */



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]