aboutsummaryrefslogtreecommitdiff
path: root/nptl/tst-rwlock9.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/tst-rwlock9.c')
-rw-r--r--nptl/tst-rwlock9.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/nptl/tst-rwlock9.c b/nptl/tst-rwlock9.c
index ae2fd96bd2..a7ea34fae6 100644
--- a/nptl/tst-rwlock9.c
+++ b/nptl/tst-rwlock9.c
@@ -34,11 +34,11 @@
#define TIMEOUT 1000000
#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 *
@@ -156,6 +156,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);