aboutsummaryrefslogtreecommitdiff
path: root/nptl/tst-rwlock8.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/tst-rwlock8.c')
-rw-r--r--nptl/tst-rwlock8.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/nptl/tst-rwlock8.c b/nptl/tst-rwlock8.c
index 9baecac..5f3174d 100644
--- a/nptl/tst-rwlock8.c
+++ b/nptl/tst-rwlock8.c
@@ -32,11 +32,11 @@
#define DELAY 1000000
-#ifndef INIT
-# define INIT PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
+#ifndef KIND
+# define KIND PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP
#endif
-static pthread_rwlock_t lock = INIT;
+static pthread_rwlock_t lock;
static void *
@@ -118,6 +118,25 @@ do_test (void)
pthread_t thrd[NREADERS];
int n;
void *res;
+ pthread_rwlockattr_t a;
+
+ if (pthread_rwlockattr_init (&a) != 0)
+ {
+ puts ("rwlockattr_t failed");
+ exit (1);
+ }
+
+ if (pthread_rwlockattr_setkind_np (&a, KIND) != 0)
+ {
+ puts ("rwlockattr_setkind failed");
+ exit (1);
+ }
+
+ if (pthread_rwlock_init (&lock, &a) != 0)
+ {
+ puts ("rwlock_init failed");
+ exit (1);
+ }
/* Make standard error the same as standard output. */
dup2 (1, 2);