summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-09-21 07:40:24 +0000
committerUlrich Drepper <drepper@redhat.com>2003-09-21 07:40:24 +0000
commit71451de2f1245b21ce3ba407068c453a866c03d6 (patch)
tree6646149e32cd4e762f758fa4796a62aab0ea8adf /nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
parent56a4aa9886dc1145f8feac66b66216a44cb092c1 (diff)
downloadglibc-71451de2f1245b21ce3ba407068c453a866c03d6.tar.gz
Update.
2003-09-21 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the locking macros. No distinction between normal and mutex locking anymore. * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex locking. Merge bits from lowlevelmutex.S we still need. * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed. * Makefile (routines): Remove libc-lowlevelmutex. (libpthread-rountines): Remove lowlevelmutex. * pthread_barrier_wait.S: Adjust for new mutex implementation. * pthread_cond_broadcast.S: Likewise. * pthread_cond_timedwait.S: Likewise. * pthread_cond_wait.S: Likewise. * pthread_rwlock_rdlock.S: Likewise. * pthread_rwlock_timedrdlock.S: Likewise. * pthread_rwlock_timedwrlock.S: Likewise. * pthread_rwlock_unlock.S: Likewise. * pthread_rwlock_wrlock.S: Likewise. * pthread_cond_signal.S: Likewise. Don't use requeue.
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S34
1 files changed, 7 insertions, 27 deletions
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 95f3aad1d8..d86ee054a9 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
@@ -45,18 +45,18 @@
__pthread_cond_signal:
pushl %ebx
- pushl %esi
pushl %edi
- movl 16(%esp), %edi
+ movl 12(%esp), %edi
/* Get internal lock. */
- movl $1, %eax
+ movl $1, %edx
+ xorl %eax, %eax
LOCK
#if cond_lock == 0
- xaddl %eax, (%edi)
+ cmpxchgl %edx, (%edi)
#else
- xaddl %eax, cond_lock(%edi)
+ cmpxchgl %edx, cond_lock(%edi)
#endif
testl %eax, %eax
jne 1f
@@ -78,21 +78,11 @@ __pthread_cond_signal:
adcl $0, 4(%ebx)
/* Wake up one thread by moving it to the internal lock futex. */
- movl $FUTEX_REQUEUE, %ecx
+ movl $FUTEX_WAKE, %ecx
movl $SYS_futex, %eax
- xorl %edx, %edx
- movl $1, %esi
+ movl $1, %edx
ENTER_KERNEL
-#ifndef __ASSUME_FUTEX_REQUEUE
- cmpl $-EINVAL, %eax
- je 7f
-#endif
-
- /* If we moved a thread we in any case have to make the syscall. */
- testl %eax, %eax
- jne 5f
-
/* Unlock. Note that at this point %edi always points to
cond_lock. */
4: LOCK
@@ -101,7 +91,6 @@ __pthread_cond_signal:
6: xorl %eax, %eax
popl %edi
- popl %esi
popl %ebx
ret
@@ -119,15 +108,6 @@ __pthread_cond_signal:
5: movl %edi, %eax
call __lll_mutex_unlock_wake
jmp 6b
-
-#ifndef __ASSUME_FUTEX_REQUEUE
-7: /* The futex requeue functionality is not available. */
- movl $1, %edx
- movl $FUTEX_WAKE, %ecx
- movl $SYS_futex, %eax
- ENTER_KERNEL
- jmp 4b
-#endif
.size __pthread_cond_signal, .-__pthread_cond_signal
versioned_symbol (libpthread, __pthread_cond_signal, pthread_cond_signal,
GLIBC_2_3_2)