about summary refs log tree commit diff
path: root/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S21
1 files changed, 12 insertions, 9 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
index f88d2d33bb..5799d8f862 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
@@ -56,12 +56,13 @@ __pthread_cond_timedwait:
 	movl	28(%esp), %ebp
 
 	/* Get internal lock.  */
-	movl	$1, %eax
+	movl	$1, %edx
+	xorl	%eax, %eax
 	LOCK
 #if cond_lock == 0
-	xaddl	%eax, (%ebx)
+	cmpxchgl %edx, (%ebx)
 #else
-	xaddl	%eax, cond_lock(%ebx)
+	cmpxchgl %edx, cond_lock(%ebx)
 #endif
 	testl	%eax, %eax
 	jne	1f
@@ -170,12 +171,13 @@ __pthread_cond_timedwait:
 .LcleanupEND:
 
 	/* Lock.  */
-	movl	$1, %eax
+	movl	$1, %edx
+	xorl	%eax, %eax
 	LOCK
 #if cond_lock == 0
-	xaddl	%eax, (%ebx)
+	cmpxchgl %edx, (%ebx)
 #else
-	xaddl	%eax, cond_lock(%ebx)
+	cmpxchgl %edx, cond_lock(%ebx)
 #endif
 	testl	%eax, %eax
 	jne	5f
@@ -353,12 +355,13 @@ __condvar_tw_cleanup:
 	movl	%eax, %esi
 
 	/* Get internal lock.  */
-	movl	$1, %eax
+	movl	$1, %edx
+	xorl	%eax, %eax
 	LOCK
 #if cond_lock == 0
-	xaddl	%eax, (%ebx)
+	cmpxchgl %edx, (%ebx)
 #else
-	xaddl	%eax, cond_lock(%ebx)
+	cmpxchgl %edx, cond_lock(%ebx)
 #endif
 	testl	%eax, %eax
 	je	1f