diff options
author | davidxu <davidxu@FreeBSD.org> | 2010-09-15 02:56:32 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2010-09-15 02:56:32 +0000 |
commit | b00fcaa22c4d87d8f0c95731f5e8325abfbc2075 (patch) | |
tree | fedf4c03bd378db206ea154a805f96e271f05b28 /lib/libthr/thread/thr_create.c | |
parent | 6be463abbb69aa61ab186c9cba314068612328ba (diff) | |
download | FreeBSD-src-b00fcaa22c4d87d8f0c95731f5e8325abfbc2075.zip FreeBSD-src-b00fcaa22c4d87d8f0c95731f5e8325abfbc2075.tar.gz |
add code to support stack unwinding when thread exits. note that only
defer-mode cancellation works, asynchrnous mode does not work because
it lacks of libuwind's support. stack unwinding is not enabled unless
LIBTHR_UNWIND_STACK is defined in Makefile.
Diffstat (limited to 'lib/libthr/thread/thr_create.c')
-rw-r--r-- | lib/libthr/thread/thr_create.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c index d4f5a11..f0af20b 100644 --- a/lib/libthr/thread/thr_create.c +++ b/lib/libthr/thread/thr_create.c @@ -264,6 +264,11 @@ thread_start(struct pthread *curthread) __sys_sigprocmask(SIG_SETMASK, &set, NULL); } +#ifdef _PTHREAD_FORCED_UNWIND + curthread->unwind_stackend = (char *)curthread->attr.stackaddr_attr + + curthread->attr.stacksize_attr; +#endif + /* Run the current thread's start routine with argument: */ _pthread_exit(curthread->start_routine(curthread->arg)); |