4 * Test stack unwinding for mixed pthread_cleanup_push/pop and C++
5 * object, both should work together.
11 #include <semaphore.h>
23 pthread_mutex_lock(&mtx);
24 pthread_cond_wait(&cv, &mtx);
25 pthread_mutex_unlock(&mtx);
26 printf("Bug, thread shouldn't be here.\n");
37 pthread_cleanup_push(cleanup_handler, NULL);
39 pthread_cleanup_pop(0);
48 pthread_mutex_init(&mtx, NULL);
49 pthread_cond_init(&cv, NULL);
50 pthread_create(&td, NULL, thr, NULL);
53 pthread_join(td, NULL);