[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r6278 - in /fsf/trunk/libc/nptl: Makefile tst-rwlock2.c tst-rwlock2a.c



Author: eglibc
Date: Sun Jun  1 00:06:04 2008
New Revision: 6278

Log:
Import glibc-mainline for 2008-06-01

Added:
    fsf/trunk/libc/nptl/tst-rwlock2a.c
Modified:
    fsf/trunk/libc/nptl/Makefile
    fsf/trunk/libc/nptl/tst-rwlock2.c

Modified: fsf/trunk/libc/nptl/Makefile
==============================================================================
--- fsf/trunk/libc/nptl/Makefile (original)
+++ fsf/trunk/libc/nptl/Makefile Sun Jun  1 00:06:04 2008
@@ -210,9 +210,9 @@
 	tst-robust6 tst-robust7 tst-robust8 tst-robust9 \
 	tst-robustpi1 tst-robustpi2 tst-robustpi3 tst-robustpi4 tst-robustpi5 \
 	tst-robustpi6 tst-robustpi7 tst-robustpi8 tst-robustpi9 \
-	tst-rwlock1 tst-rwlock2 tst-rwlock3 tst-rwlock4 tst-rwlock5 \
-	tst-rwlock6 tst-rwlock7 tst-rwlock8 tst-rwlock9 tst-rwlock10 \
-	tst-rwlock11 tst-rwlock12 tst-rwlock13 tst-rwlock14 \
+	tst-rwlock1 tst-rwlock2 tst-rwlock2a tst-rwlock3 tst-rwlock4 \
+	tst-rwlock5 tst-rwlock6 tst-rwlock7 tst-rwlock8 tst-rwlock9 \
+	tst-rwlock10 tst-rwlock11 tst-rwlock12 tst-rwlock13 tst-rwlock14 \
 	tst-once1 tst-once2 tst-once3 tst-once4 \
 	tst-key1 tst-key2 tst-key3 tst-key4 \
 	tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem5 tst-sem6 tst-sem7 \

Modified: fsf/trunk/libc/nptl/tst-rwlock2.c
==============================================================================
--- fsf/trunk/libc/nptl/tst-rwlock2.c (original)
+++ fsf/trunk/libc/nptl/tst-rwlock2.c Sun Jun  1 00:06:04 2008
@@ -26,14 +26,40 @@
 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)
     {

Added: fsf/trunk/libc/nptl/tst-rwlock2a.c
==============================================================================
--- fsf/trunk/libc/nptl/tst-rwlock2a.c (added)
+++ fsf/trunk/libc/nptl/tst-rwlock2a.c Sun Jun  1 00:06:04 2008
@@ -1,0 +1,2 @@
+#define TYPE PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP
+#include "tst-rwlock2.c"