003 File Manager
Current Path:
/usr/src/tools/regression/pthread/unwind
usr
/
src
/
tools
/
regression
/
pthread
/
unwind
/
📁
..
📄
Makefile
(537 B)
📄
Test.cpp
(578 B)
📄
catch_pthread_exit.cpp
(498 B)
📄
cond_wait_cancel.cpp
(626 B)
📄
cond_wait_cancel2.cpp
(795 B)
📄
main_thread_exit.cpp
(229 B)
📄
sem_wait_cancel.cpp
(470 B)
📄
thread_normal_exit.cpp
(391 B)
Editing: catch_pthread_exit.cpp
/* $FreeBSD$ */ /* try to catch thread exiting, and rethrow the exception */ #include <pthread.h> #include <stdio.h> #include <stdlib.h> int caught; void * thr_routine(void *arg) { try { pthread_exit(NULL); } catch (...) { caught = 1; printf("thread exiting exception caught\n"); /* rethrow */ throw; } } int main() { pthread_t td; pthread_create(&td, NULL, thr_routine, NULL); pthread_join(td, NULL); if (caught) printf("OK\n"); else printf("failure\n"); return (0); }
Upload File
Create Folder