about summary refs log tree commit diff
path: root/nptl/sysdeps/unix/sysv/linux/i386
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-03-01 06:38:24 +0000
committerUlrich Drepper <drepper@redhat.com>2004-03-01 06:38:24 +0000
commitebddb42437ef37b15b1be1d82589b909c6799b1c (patch)
treebc7b6f6636880aacb55422ca06a7335da1bddb74 /nptl/sysdeps/unix/sysv/linux/i386
parent7a49a7d5b7cfd40e4ea7f6544c9f92e997254c10 (diff)
downloadglibc-ebddb42437ef37b15b1be1d82589b909c6799b1c.tar.gz
glibc-ebddb42437ef37b15b1be1d82589b909c6799b1c.tar.xz
glibc-ebddb42437ef37b15b1be1d82589b909c6799b1c.zip
(__lll_mutex_lock_wait): Optimize a bit more. Just one copy of the atomic instruction needed.
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/i386')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S12
1 files changed, 3 insertions, 9 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
index 600ba75874..96ea35caac 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
@@ -51,24 +51,18 @@ __lll_mutex_lock_wait:
 	xorl	%ecx, %ecx	/* movl $FUTEX_WAIT, %ecx */
 
 	cmpl	%edx, %eax	/* NB:	 %edx == 2 */
-	je 1f
-
-	movl	%edx, %eax
-	xchgl	%eax, (%ebx)	/* NB:	 lock is implied */
-
-	testl	%eax, %eax
-	je	2f
+	jne 2f
 
 1:	movl	$SYS_futex, %eax
 	ENTER_KERNEL
 
-	movl	%edx, %eax
+2:	movl	%edx, %eax
 	xchgl	%eax, (%ebx)	/* NB:	 lock is implied */
 
 	testl	%eax, %eax
 	jnz,pn	1b
 
-2:	popl	%esi
+	popl	%esi
 	popl	%ebx
 	popl	%edx
 	ret