mc_translate.c: enable further uses of DLexpensive for scalar EQ/NE comparisons
[valgrind.git] / none / tests / pth_rwlock.c
blob75486ea983c2dc8e342393dbb1bfd435a021a42f
1 #define _XOPEN_SOURCE 600
3 #include <pthread.h>
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <string.h>
8 #define LOCKS 2000
10 int main(int argc, char **argv)
12 pthread_rwlock_t locks[LOCKS];
13 int n;
14 int e;
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);
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);
30 exit(0);