about summary refs log tree commit diff
path: root/nptl/tst-rwlock2.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-06-12 16:53:43 +0000
committerJakub Jelinek <jakub@redhat.com>2008-06-12 16:53:43 +0000
commit72d4ac23660326e76443cf18f0ed8c2e4792d268 (patch)
treedec24311250bb61298456c3eb0e8937c3a4b7561 /nptl/tst-rwlock2.c
parent8ba7d5cebbd4acf40dc8d22982baa50c2e1fd194 (diff)
downloadglibc-72d4ac23660326e76443cf18f0ed8c2e4792d268.tar.gz
glibc-72d4ac23660326e76443cf18f0ed8c2e4792d268.tar.xz
glibc-72d4ac23660326e76443cf18f0ed8c2e4792d268.zip
Updated to fedora-glibc-20080612T1619 cvs/fedora-glibc-2_8_90-6
Diffstat (limited to 'nptl/tst-rwlock2.c')
-rw-r--r--nptl/tst-rwlock2.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/nptl/tst-rwlock2.c b/nptl/tst-rwlock2.c
index 6f38682b85..2d2e8e4a3e 100644
--- a/nptl/tst-rwlock2.c
+++ b/nptl/tst-rwlock2.c
@@ -26,15 +26,41 @@ static int
 do_test (void)
 {
   pthread_rwlock_t r;
+  pthread_rwlockattr_t at;
   int e;
 
-  if (pthread_rwlock_init (&r, NULL) != 0)
+  if (pthread_rwlockattr_init (&at) != 0)
+    {
+      puts ("rwlockattr_init failed");
+      return 1;
+    }
+  puts ("rwlockattr_init succeeded");
+
+#ifndef TYPE
+# define TYPE PTHREAD_RWLOCK_PREFER_READER_NP
+#endif
+
+  if (pthread_rwlockattr_setkind_np (&at, TYPE) != 0)
+    {
+      puts ("rwlockattr_setkind failed");
+      return 1;
+    }
+  puts ("rwlockattr_setkind succeeded");
+
+  if (pthread_rwlock_init (&r, &at) != 0)
     {
       puts ("rwlock_init failed");
       return 1;
     }
   puts ("rwlock_init succeeded");
 
+  if (pthread_rwlockattr_destroy (&at) != 0)
+    {
+      puts ("rwlockattr_destroy failed");
+      return 1;
+    }
+  puts ("rwlockattr_destroy succeeded");
+
   if (pthread_rwlock_wrlock (&r) != 0)
     {
       puts ("1st rwlock_wrlock failed");