blob: 75486ea983c2dc8e342393dbb1bfd435a021a42f [file] [log] [blame]
thughes8542e0f2004-10-16 14:49:53 +00001#define _XOPEN_SOURCE 600
2
3#include <pthread.h>
4#include <stdio.h>
5#include <stdlib.h>
6#include <string.h>
7
8#define LOCKS 2000
9
10int main(int argc, char **argv)
11{
12 pthread_rwlock_t locks[LOCKS];
13 int n;
14 int e;
15
16 for (n = 0; n < LOCKS; n++) {
17 if ((e = pthread_rwlock_init(locks + n, NULL)) != 0) {
18 fprintf(stderr, "pthread_rwlock_init[%d]: %s\n", n, strerror(e));
19 exit(1);
20 }
21 }
22
23 for (n = 0; n < LOCKS; n++) {
24 if ((e = pthread_rwlock_destroy(locks + n)) != 0) {
25 fprintf(stderr, "pthread_rwlock_destroy[%d]: %s\n", n, strerror(e));
26 exit(1);
27 }
28 }
29
30 exit(0);
31}