about summary refs log tree commit diff
path: root/nptl/tst-rwlock6.c
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/tst-rwlock6.c
parentad032aee17008c7799fee97679a6d20efdcd7bee (diff)
downloadglibc-51d0678c29b8e49e838c85d0ee7e98210a105695.tar.gz
glibc-51d0678c29b8e49e838c85d0ee7e98210a105695.tar.xz
glibc-51d0678c29b8e49e838c85d0ee7e98210a105695.zip
Update.
2003-03-16  Ulrich Drepper  <drepper@redhat.com>

	* tst-rwlock6.c: Add some more status output.
Diffstat (limited to 'nptl/tst-rwlock6.c')
-rw-r--r--nptl/tst-rwlock6.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/nptl/tst-rwlock6.c b/nptl/tst-rwlock6.c
index ea7f4ba634..86cd10b5ee 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);