summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-06-17 23:58:15 +0000
committerUlrich Drepper <drepper@redhat.com>2004-06-17 23:58:15 +0000
commit7c370086323e3915607c4b1021c817746ac991c9 (patch)
treeab382b3dea191b708ddde13b151473764337ffb9 /nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
parentc7be5c15e2fbccdc00b970c3b5b9c27e95dee5be (diff)
downloadglibc-7c370086323e3915607c4b1021c817746ac991c9.tar.gz
Update.
2004-06-13 Kaz Kojima <kkojima@rr.iij4u.or.jp> * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock. * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S (__pthread_cond_signal): Increment __futex at the same time as __wakeup_seq or __total_seq. Pass address of __futex instead of address of low 32-bits of __wakeup_seq to futex syscall. * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S (__pthread_cond_wait): Likewise. Pass __futex value from before releasing internal lock to FUTEX_WAIT. * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S (__pthread_cond_timedwait): Likewise. * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S (FUTEX_CMP_REQUEUE): Define. (__pthread_cond_broadcast): Set __futex to 2 * __total_seq. Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE. Pass __futex value from before the unlock and __futex address instead of address of low 32-bits of __wakeup_seq to futex syscall. Fallback to FUTEX_WAKE all on any errors.
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S18
1 files changed, 15 insertions, 3 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
index b9d8f5b920..2d0df6b5bf 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
@@ -110,6 +110,10 @@ __pthread_cond_timedwait:
addc r3, r1
mov.l r0,@(total_seq,r8)
mov.l r1,@(total_seq+4,r8)
+ mov.l @(cond_futex,r8), r0
+ add r2, r0
+ mov.l r0, @(cond_futex,r8)
+
/* Get and store current wakeup_seq value. */
mov.l @(wakeup_seq,r8), r10
@@ -150,6 +154,8 @@ __pthread_cond_timedwait:
/* Store relative timeout. */
mov.l r2, @(16,r15)
mov.l r3, @(20,r15)
+ mov.l @(cond_futex,r8), r1
+ mov.l r1, @(8,r15)
/* Unlock. */
#if cond_lock != 0
@@ -172,9 +178,9 @@ __pthread_cond_timedwait:
mov r15, r7
add #16, r7
mov #FUTEX_WAIT, r5
- mov r10, r6
+ mov.l @(8,r15), r6
mov r8, r4
- add #wakeup_seq, r4
+ add #cond_futex, r4
mov #SYS_futex, r3
extu.b r3, r3
trapa #0x14
@@ -232,6 +238,9 @@ __pthread_cond_timedwait:
addc r3, r1
mov.l r0,@(wakeup_seq,r8)
mov.l r1,@(wakeup_seq+4,r8)
+ mov.l @(cond_futex,r8),r0
+ add r2, r0
+ mov.l r0,@(cond_futex,r8)
mov #ETIMEDOUT, r0
bra 14f
mov.l r0, @(24,r15)
@@ -433,6 +442,9 @@ __condvar_tw_cleanup:
addc r3, r1
mov.l r0,@(wakeup_seq,r8)
mov.l r1,@(wakeup_seq+4,r8)
+ mov.l @(cond_futex,r8),r0
+ add r2, r0
+ mov.l r0,@(cond_futex,r8)
clrt
mov.l @(woken_seq,r8),r0
@@ -463,7 +475,7 @@ __condvar_tw_cleanup:
2:
/* Wake up all waiters to make sure no signal gets lost. */
mov r8, r4
- add #wakeup_seq, r4
+ add #cond_futex, r4
mov #FUTEX_WAKE, r5
mov #-1, r6
shlr r6 /* r6 = 0x7fffffff */