f7dfce
diff -Nrup c/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S d/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
f7dfce
--- c/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S	2012-05-20 23:58:20.732670548 -0600
f7dfce
+++ d/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S	2012-05-20 23:58:52.667518135 -0600
b37e2e
@@ -137,7 +137,6 @@ __pthread_cond_wait:
25912e
 	cmpl	$PI_BIT, %eax
25912e
 	jne	18f
25912e
 
25912e
-90:
25912e
 	movl	$(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx
25912e
 	movl	%ebp, %edx
25912e
 	xorl	%esi, %esi
b37e2e
@@ -151,9 +150,6 @@ __pthread_cond_wait:
25912e
 	sete	16(%esp)
25912e
 	je	19f
25912e
 
25912e
-	cmpl	$-EAGAIN, %eax
25912e
-	je	91f
25912e
-
25912e
 	/* Normal and PI futexes dont mix. Use normal futex functions only
25912e
 	   if the kernel does not support the PI futex functions.  */
25912e
 	cmpl	$-ENOSYS, %eax
b37e2e
@@ -398,78 +394,6 @@ __pthread_cond_wait:
25912e
 #endif
25912e
 	call	__lll_unlock_wake
25912e
 	jmp	11b
25912e
-
25912e
-91:
25912e
-.LcleanupSTART2:
25912e
-	/* FUTEX_WAIT_REQUEUE_PI returned EAGAIN.  We need to
25912e
-	   call it again.  */
25912e
-
25912e
-	/* Get internal lock.  */
25912e
-	movl	$1, %edx
25912e
-	xorl	%eax, %eax
25912e
-	LOCK
25912e
-#if cond_lock == 0
25912e
-	cmpxchgl %edx, (%ebx)
25912e
-#else
25912e
-	cmpxchgl %edx, cond_lock(%ebx)
25912e
-#endif
25912e
-	jz	92f
25912e
-
25912e
-#if cond_lock == 0
25912e
-	movl	%ebx, %edx
25912e
-#else
25912e
-	leal	cond_lock(%ebx), %edx
25912e
-#endif
25912e
-#if (LLL_SHARED-LLL_PRIVATE) > 255
25912e
-	xorl	%ecx, %ecx
25912e
-#endif
25912e
-	cmpl	$-1, dep_mutex(%ebx)
25912e
-	setne	%cl
25912e
-	subl	$1, %ecx
25912e
-	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
25912e
-#if LLL_PRIVATE != 0
25912e
-	addl	$LLL_PRIVATE, %ecx
25912e
-#endif
25912e
-	call	__lll_lock_wait
25912e
-
25912e
-92:
25912e
-	/* Increment the cond_futex value again, so it can be used as a new
25912e
-	   expected value. */
25912e
-	addl	$1, cond_futex(%ebx)
25912e
-	movl	cond_futex(%ebx), %ebp
25912e
-
25912e
-	/* Unlock.  */
25912e
-	LOCK
25912e
-#if cond_lock == 0
25912e
-	subl	$1, (%ebx)
25912e
-#else
25912e
-	subl	$1, cond_lock(%ebx)
25912e
-#endif
25912e
-	je	93f
25912e
-#if cond_lock == 0
25912e
-	movl	%ebx, %eax
25912e
-#else
25912e
-	leal	cond_lock(%ebx), %eax
25912e
-#endif
25912e
-#if (LLL_SHARED-LLL_PRIVATE) > 255
25912e
-	xorl	%ecx, %ecx
25912e
-#endif
25912e
-	cmpl	$-1, dep_mutex(%ebx)
25912e
-	setne	%cl
25912e
-	subl	$1, %ecx
25912e
-	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
25912e
-#if LLL_PRIVATE != 0
25912e
-	addl	$LLL_PRIVATE, %ecx
25912e
-#endif
25912e
-	call	__lll_unlock_wake
25912e
-
25912e
-93:
25912e
-	/* Set the rest of SYS_futex args for FUTEX_WAIT_REQUEUE_PI. */
25912e
-	xorl	%ecx, %ecx
25912e
-	movl	dep_mutex(%ebx), %edi
25912e
-	jmp	90b
25912e
-.LcleanupEND2:
25912e
-
25912e
 	.size	__pthread_cond_wait, .-__pthread_cond_wait
25912e
 versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
25912e
 		  GLIBC_2_3_2)
b37e2e
@@ -642,10 +566,6 @@ __condvar_w_cleanup:
25912e
 	.long	.LcleanupEND-.Lsub_cond_futex
25912e
 	.long	__condvar_w_cleanup-.LSTARTCODE
25912e
 	.uleb128  0
25912e
-	.long	.LcleanupSTART2-.LSTARTCODE
25912e
-	.long	.LcleanupEND2-.LcleanupSTART2
25912e
-	.long	__condvar_w_cleanup-.LSTARTCODE
25912e
-	.uleb128  0
25912e
 	.long	.LcallUR-.LSTARTCODE
25912e
 	.long	.LENDCODE-.LcallUR
25912e
 	.long	0
f7dfce
diff -Nrup c/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S d/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
f7dfce
--- c/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S	2012-05-20 23:58:20.736670528 -0600
f7dfce
+++ d/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S	2012-05-21 00:01:39.870720001 -0600
f7dfce
@@ -136,14 +136,11 @@ __pthread_cond_wait:
25912e
 	cmpl	$PI_BIT, %eax
25912e
 	jne	61f
25912e
 
25912e
-90:
25912e
 	movl	$(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %esi
25912e
 	movl	$SYS_futex, %eax
25912e
 	syscall
25912e
 
25912e
 	movl	$1, %r8d
25912e
-	cmpq	$-EAGAIN, %rax
25912e
-	je	91f
25912e
 #ifdef __ASSUME_REQUEUE_PI
25912e
 	jmp	62f
25912e
 #else
f7dfce
@@ -331,69 +328,6 @@ __pthread_cond_wait:
25912e
 13:	movq	%r10, %rax
25912e
 	jmp	14b
f7dfce
 
25912e
-91:
25912e
-.LcleanupSTART2:
25912e
-	/* FUTEX_WAIT_REQUEUE_PI returned EAGAIN.  We need to
25912e
-	   call it again.  */
25912e
-	movq	8(%rsp), %rdi
25912e
-
25912e
-	/* Get internal lock.  */
25912e
-	movl	$1, %esi
25912e
-	xorl	%eax, %eax
25912e
-	LOCK
25912e
-#if cond_lock == 0
25912e
-	cmpxchgl %esi, (%rdi)
25912e
-#else
25912e
-	cmpxchgl %esi, cond_lock(%rdi)
25912e
-#endif
25912e
-	jz	92f
25912e
-
25912e
-#if cond_lock != 0
25912e
-	addq	$cond_lock, %rdi
25912e
-#endif
f7dfce
-	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
25912e
-	movl	$LLL_PRIVATE, %eax
25912e
-	movl	$LLL_SHARED, %esi
25912e
-	cmovne	%eax, %esi
25912e
-	callq	__lll_lock_wait
25912e
-#if cond_lock != 0
25912e
-	subq	$cond_lock, %rdi
25912e
-#endif
25912e
-92:
25912e
-	/* Increment the cond_futex value again, so it can be used as a new
25912e
-	   expected value. */
25912e
-	incl	cond_futex(%rdi)
25912e
-	movl	cond_futex(%rdi), %edx
25912e
-
25912e
-	/* Release internal lock.  */
25912e
-	LOCK
25912e
-#if cond_lock == 0
25912e
-	decl	(%rdi)
25912e
-#else
25912e
-	decl	cond_lock(%rdi)
25912e
-#endif
25912e
-	jz	93f
25912e
-
25912e
-#if cond_lock != 0
25912e
-	addq	$cond_lock, %rdi
25912e
-#endif
f7dfce
-	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
25912e
-	movl	$LLL_PRIVATE, %eax
25912e
-	movl	$LLL_SHARED, %esi
25912e
-	cmovne	%eax, %esi
25912e
-	/* The call preserves %rdx.  */
25912e
-	callq	__lll_unlock_wake
25912e
-#if cond_lock != 0
25912e
-	subq	$cond_lock, %rdi
25912e
-#endif
25912e
-93:
25912e
-	/* Set the rest of SYS_futex args for FUTEX_WAIT_REQUEUE_PI. */
25912e
-	xorq	%r10, %r10
f7dfce
-	mov	dep_mutex(%rdi), %R8_LP
25912e
-	leaq	cond_futex(%rdi), %rdi
25912e
-	jmp	90b
25912e
-.LcleanupEND2:
25912e
-
25912e
 	.size	__pthread_cond_wait, .-__pthread_cond_wait
25912e
 versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
25912e
 		  GLIBC_2_3_2)
f7dfce
@@ -546,15 +480,11 @@ __condvar_cleanup1:
25912e
 	.uleb128 .LcleanupSTART-.LSTARTCODE
25912e
 	.uleb128 .LcleanupEND-.LcleanupSTART
25912e
 	.uleb128 __condvar_cleanup1-.LSTARTCODE
25912e
-	.uleb128 0
25912e
-	.uleb128 .LcleanupSTART2-.LSTARTCODE
25912e
-	.uleb128 .LcleanupEND2-.LcleanupSTART2
25912e
-	.uleb128 __condvar_cleanup1-.LSTARTCODE
25912e
-	.uleb128 0
25912e
+	.uleb128  0
25912e
 	.uleb128 .LcallUR-.LSTARTCODE
25912e
 	.uleb128 .LENDCODE-.LcallUR
25912e
 	.uleb128 0
25912e
-	.uleb128 0
25912e
+	.uleb128  0
25912e
 .Lcstend:
25912e
 
25912e