From owner-svn-src-head@FreeBSD.ORG Sun Sep 26 06:45:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B1EC106564A; Sun, 26 Sep 2010 06:45:24 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A92A8FC15; Sun, 26 Sep 2010 06:45:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8Q6jORA084458; Sun, 26 Sep 2010 06:45:24 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8Q6jOgA084456; Sun, 26 Sep 2010 06:45:24 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009260645.o8Q6jOgA084456@svn.freebsd.org> From: David Xu Date: Sun, 26 Sep 2010 06:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213182 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Sep 2010 06:45:24 -0000 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!");