Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Sep 2010 06:45:24 +0000 (UTC)
From:      David Xu <davidxu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r213182 - head/lib/libthr/thread
Message-ID:  <201009260645.o8Q6jOgA084456@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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!");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009260645.o8Q6jOgA084456>