1 // commit: 1a9a2ff7b0daf99100db53440a0b18b2801566ca 2011-02-13
2 // pthread_exit should call cancelation handlers
7 #define TEST(r, f) if (((r)=(f))) t_error(#f " failed: %s\n", strerror(r))
9 static void cleanup(void *arg
)
14 static void *start(void *arg
)
16 pthread_cleanup_push(cleanup
, arg
);
18 pthread_cleanup_pop(0);
29 TEST(r
, pthread_create(&td
, 0, start
, &arg
));
30 TEST(r
, pthread_join(td
, &status
));
32 t_error("expected 0 thread exit status, got 0x%lx\n", (long)status
);
34 t_error("cleanup handler failed to run\n");