Changeset View
Changeset View
Standalone View
Standalone View
tools/regression/pthread/mutex_isowned_np/mutex_isowned_np.c
Show All 40 Lines | if (pthread_mutex_isowned_np(mtx) != 0) { | ||||
printf("pthread_mutex_isowned_np() returned non-zero\n" | printf("pthread_mutex_isowned_np() returned non-zero\n" | ||||
"for a mutex held by another thread\n"); | "for a mutex held by another thread\n"); | ||||
exit(1); | exit(1); | ||||
} | } | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
int | int | ||||
main(int argc, char *argv[]) | main(int argc __unused, char *argv[] __unused) | ||||
{ | { | ||||
pthread_t thr; | pthread_t thr; | ||||
pthread_mutex_t mtx; | pthread_mutex_t mtx; | ||||
pthread_mutex_init(&mtx, NULL); | pthread_mutex_init(&mtx, NULL); | ||||
if (pthread_mutex_isowned_np(&mtx) != 0) { | if (pthread_mutex_isowned_np(&mtx) != 0) { | ||||
printf("pthread_mutex_isowned_np() returned non-zero\n" | printf("pthread_mutex_isowned_np() returned non-zero\n" | ||||
"for a mutex that is not held\n"); | "for a mutex that is not held\n"); | ||||
Show All 20 Lines |