From 1d5b5089aa2c27995cf84dc9e12eebb48b11b9ff Mon Sep 17 00:00:00 2001 From: David Xu Date: Sun, 26 Sep 2010 06:45:24 +0000 Subject: [PATCH] Report death event to debugger before moving to gc list, otherwise debugger may can not find it on thread list. --- lib/libthr/thread/thr_exit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/libthr/thread/thr_exit.c b/lib/libthr/thread/thr_exit.c index 4cd581e2f2d..0dc7e2d1dba 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!");