Author: davidxu
Date: Sun Sep 26 06:45:24 2010
New Revision: 213182
URL: http://svn.freebsd.org/changeset/base/213182

Log:
  Report death event to debugger before moving to gc list, otherwise
  debugger may can not find it on thread list.

Modified:
  head/lib/libthr/thread/thr_exit.c

Modified: head/lib/libthr/thread/thr_exit.c
==============================================================================
--- head/lib/libthr/thread/thr_exit.c   Sun Sep 26 01:45:33 2010        
(r213181)
+++ head/lib/libthr/thread/thr_exit.c   Sun Sep 26 06:45:24 2010        
(r213182)
@@ -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!");
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to