summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2010-09-26 06:45:24 +0000
committerdavidxu <davidxu@FreeBSD.org>2010-09-26 06:45:24 +0000
commit56cf3f4638b438377f6172652c2723db71a426b2 (patch)
tree939718f867e41e19ca940634e93e90b6535234d7 /lib/libthr
parenta774d4e29c403d77f8e5419067d8c94733e670d7 (diff)
downloadFreeBSD-src-56cf3f4638b438377f6172652c2723db71a426b2.zip
FreeBSD-src-56cf3f4638b438377f6172652c2723db71a426b2.tar.gz
Report death event to debugger before moving to gc list, otherwise
debugger may can not find it on thread list.
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/thread/thr_exit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libthr/thread/thr_exit.c b/lib/libthr/thread/thr_exit.c
index 4cd581e..0dc7e2d 100644
--- a/lib/libthr/thread/thr_exit.c
+++ b/lib/libthr/thread/thr_exit.c
@@ -286,6 +286,8 @@ exit_thread(void)
curthread->cycle++;
_thr_umtx_wake(&curthread->cycle, INT_MAX, 0);
}
+ if (!curthread->force_exit && SHOULD_REPORT_EVENT(curthread, TD_DEATH))
+ _thr_report_death(curthread);
/*
* Thread was created with initial refcount 1, we drop the
* reference count to allow it to be garbage collected.
@@ -293,9 +295,6 @@ exit_thread(void)
curthread->refcount--;
_thr_try_gc(curthread, curthread); /* thread lock released */
- if (!curthread->force_exit && SHOULD_REPORT_EVENT(curthread, TD_DEATH))
- _thr_report_death(curthread);
-
#if defined(_PTHREADS_INVARIANTS)
if (THR_IN_CRITICAL(curthread))
PANIC("thread exits with resources held!");
OpenPOWER on IntegriCloud