From b00fcaa22c4d87d8f0c95731f5e8325abfbc2075 Mon Sep 17 00:00:00 2001 From: davidxu Date: Wed, 15 Sep 2010 02:56:32 +0000 Subject: 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. --- lib/libthr/thread/thr_init.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/libthr/thread/thr_init.c') diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index c20f3c8..56541a8 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -413,6 +413,10 @@ init_main_thread(struct pthread *thread) &sched_param); thread->attr.prio = sched_param.sched_priority; +#ifdef _PTHREAD_FORCED_UNWIND + thread->unwind_stackend = _usrstack; +#endif + /* Others cleared to zero by thr_alloc() */ } -- cgit v1.1