2 * @file rwlock_type_checking.c
4 * @brief Test whether DRD reports attempts to use a user-defined rwlock as
5 * a POSIX rwlock and vice versa.
14 #include "../../config.h"
15 #include "../../drd/drd.h"
18 int main(int argc
, char** argv
)
20 pthread_rwlock_t posix_rwlock
;
21 pthread_rwlock_t user_defined_rwlock
;
23 memset(&user_defined_rwlock
, 0, sizeof(user_defined_rwlock
));
24 ANNOTATE_RWLOCK_CREATE(&user_defined_rwlock
);
25 pthread_rwlock_init(&posix_rwlock
, 0);
27 pthread_rwlock_init((pthread_rwlock_t
*)&user_defined_rwlock
, 0);
29 ANNOTATE_READERLOCK_RELEASED(&posix_rwlock
);
31 pthread_rwlock_destroy(&posix_rwlock
);
32 ANNOTATE_RWLOCK_DESTROY(&user_defined_rwlock
);
34 fprintf(stderr
, "Finished.\n");