1 #define _XOPEN_SOURCE 600
10 int main(int argc
, char **argv
)
12 pthread_rwlock_t locks
[LOCKS
];
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
));
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
));