aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-16 08:09:26 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-16 08:09:26 +0000
commit51d0678c29b8e49e838c85d0ee7e98210a105695 (patch)
tree00c6476008122b40d8ec531ad305cf467ea48fc1 /nptl
parentad032aee17008c7799fee97679a6d20efdcd7bee (diff)
downloadglibc-51d0678c29b8e49e838c85d0ee7e98210a105695.zip
glibc-51d0678c29b8e49e838c85d0ee7e98210a105695.tar.gz
glibc-51d0678c29b8e49e838c85d0ee7e98210a105695.tar.bz2
Update.
2003-03-16 Ulrich Drepper <drepper@redhat.com> * tst-rwlock6.c: Add some more status output.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S11
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S7
-rw-r--r--nptl/tst-rwlock6.c23
4 files changed, 36 insertions, 9 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 9dd21a7..9219b27 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,7 @@
+2003-03-16 Ulrich Drepper <drepper@redhat.com>
+
+ * tst-rwlock6.c: Add some more status output.
+
2003-03-15 Roland McGrath <roland@redhat.com>
* sysdeps/pthread/configure.in: New file.
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
index fd04e11..b522f3c 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
@@ -45,6 +45,7 @@
pthread_rwlock_timedrdlock:
pushq %r12
pushq %r13
+ pushq %r14
subq $16, %rsp
movq %rdi, %r12
@@ -76,14 +77,14 @@ pthread_rwlock_timedrdlock:
incl READERS_QUEUED(%r12)
je 4f
- movl READERS_WAKEUP(%r12), %edx
+ movl READERS_WAKEUP(%r12), %r14d
/* Unlock. */
LOCK
#if MUTEX == 0
- subl $1, (%r12)
+ decl (%r12)
#else
- subl $1, MUTEX(%r12)
+ decl MUTEX(%r12)
#endif
jne 10f
@@ -112,7 +113,8 @@ pthread_rwlock_timedrdlock:
movq %rdi, 8(%rsp)
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
- xorq %r10, %r10
+ movq %rsp, %r10
+ movl %r14d, %edx
leaq READERS_WAKEUP(%r12), %rdi
movq $SYS_futex, %rax
syscall
@@ -152,6 +154,7 @@ pthread_rwlock_timedrdlock:
7: movq %rdx, %rax
addq $16, %rsp
+ popq %r14
popq %r13
popq %r12
retq
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
index 75c6cc4..6cbadab 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
@@ -44,6 +44,7 @@
pthread_rwlock_timedwrlock:
pushq %r12
pushq %r13
+ pushq %r14
subq $16, %rsp
movq %rdi, %r12
@@ -73,7 +74,7 @@ pthread_rwlock_timedwrlock:
incl WRITERS_QUEUED(%r12)
je 4f
- movl WRITERS_WAKEUP(%r12), %edx
+ movl WRITERS_WAKEUP(%r12), %r14d
LOCK
#if MUTEX == 0
@@ -109,6 +110,7 @@ pthread_rwlock_timedwrlock:
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
movq %rsp, %r10
+ movl %r14d, %edx
leaq WRITERS_WAKEUP(%r12), %rdi
movq $SYS_futex, %rax
syscall
@@ -134,7 +136,7 @@ pthread_rwlock_timedwrlock:
jmp 9f
-5: xorq %rcx, %rdx
+5: xorq %rdx, %rdx
movq %fs:SELF, %rax
movq %rax, WRITER(%r12)
9: LOCK
@@ -148,6 +150,7 @@ pthread_rwlock_timedwrlock:
7: movq %rdx, %rax
addq $16, %rsp
+ popq %r14
popq %r13
popq %r12
retq
diff --git a/nptl/tst-rwlock6.c b/nptl/tst-rwlock6.c
index ea7f4ba..86cd10b 100644
--- a/nptl/tst-rwlock6.c
+++ b/nptl/tst-rwlock6.c
@@ -51,6 +51,8 @@ tf (void *arg)
++ts.tv_sec;
}
+ puts ("child calling timedrdlock");
+
int err = pthread_rwlock_timedrdlock (r, &ts);
if (err == 0)
{
@@ -65,6 +67,8 @@ tf (void *arg)
pthread_exit ((void *) 1l);
}
+ puts ("1st child timedrdlock done");
+
struct timeval tv2;
(void) gettimeofday (&tv2, NULL);
@@ -94,6 +98,8 @@ tf (void *arg)
pthread_exit ((void *) 1l);
}
+ puts ("2nd child timedrdlock done");
+
return NULL;
}
@@ -140,16 +146,19 @@ do_test (void)
++ts.tv_sec;
/* Get a write lock. */
- if (pthread_rwlock_timedwrlock (&r, &ts) != 0)
+ int e = pthread_rwlock_timedwrlock (&r, &ts);
+ if (e != 0)
{
- printf ("round %d: rwlock_wrlock failed\n", cnt);
+ printf ("round %d: rwlock_timedwrlock failed (%d)\n", cnt, e);
exit (1);
}
+ puts ("1st timedwrlock done");
+
(void) gettimeofday (&tv, NULL);
TIMEVAL_TO_TIMESPEC (&tv, &ts);
++ts.tv_sec;
- int e = pthread_rwlock_timedrdlock (&r, &ts);
+ e = pthread_rwlock_timedrdlock (&r, &ts);
if (e == 0)
{
puts ("timedrdlock succeeded");
@@ -161,6 +170,8 @@ do_test (void)
exit (1);
}
+ puts ("1st timedrdlock done");
+
(void) gettimeofday (&tv, NULL);
TIMEVAL_TO_TIMESPEC (&tv, &ts);
++ts.tv_sec;
@@ -176,6 +187,8 @@ do_test (void)
exit (1);
}
+ puts ("2nd timedwrlock done");
+
pthread_t th;
if (pthread_create (&th, NULL, tf, &r) != 0)
{
@@ -183,6 +196,8 @@ do_test (void)
exit (1);
}
+ puts ("started thread");
+
void *status;
if (pthread_join (th, &status) != 0)
{
@@ -195,6 +210,8 @@ do_test (void)
exit (1);
}
+ puts ("joined thread");
+
if (pthread_rwlock_destroy (&r) != 0)
{
printf ("round %d: rwlock_destroy failed\n", cnt);