Report death event to debugger before moving to gc list, otherwise

debugger may can not find it on thread list.
This commit is contained in:
David Xu 2010-09-26 06:45:24 +00:00
parent f145c771fb
commit 1d5b5089aa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=213182

View File

@ -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!");