From owner-svn-src-all@FreeBSD.ORG Wed Sep 15 01:21:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 008CB106566B; Wed, 15 Sep 2010 01:21:31 +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 C96718FC0A; Wed, 15 Sep 2010 01:21:30 +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 o8F1LUtR098484; Wed, 15 Sep 2010 01:21:30 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8F1LUC9098482; Wed, 15 Sep 2010 01:21:30 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009150121.o8F1LUC9098482@svn.freebsd.org> From: David Xu Date: Wed, 15 Sep 2010 01:21:30 +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: r212629 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 01:21:31 -0000 Author: davidxu Date: Wed Sep 15 01:21:30 2010 New Revision: 212629 URL: http://svn.freebsd.org/changeset/base/212629 Log: Move back IN_GCLIST flag into field tlflags, since thread list and gc list still share same lock. Modified: head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Wed Sep 15 01:19:11 2010 (r212628) +++ head/lib/libthr/thread/thr_private.h Wed Sep 15 01:21:30 2010 (r212629) @@ -415,13 +415,13 @@ struct pthread { #define THR_FLAGS_PRIVATE 0x0001 #define THR_FLAGS_NEED_SUSPEND 0x0002 /* thread should be suspended */ #define THR_FLAGS_SUSPENDED 0x0004 /* thread is suspended */ -#define THR_FLAGS_IN_GCLIST 0x0008 /* thread in gc list */ -#define THR_FLAGS_DETACHED 0x0010 /* thread is detached */ +#define THR_FLAGS_DETACHED 0x0008 /* thread is detached */ /* Thread list flags; only set with thread list lock held. */ int tlflags; #define TLFLAGS_GC_SAFE 0x0001 /* thread safe for cleaning */ #define TLFLAGS_IN_TDLIST 0x0002 /* thread in all thread list */ +#define TLFLAGS_IN_GCLIST 0x0004 /* thread in gc list */ /* Queue of currently owned NORMAL or PRIO_INHERIT type mutexes. */ struct mutex_queue mutexq; @@ -559,16 +559,16 @@ do { \ } \ } while (0) #define THR_GCLIST_ADD(thrd) do { \ - if (((thrd)->flags & THR_FLAGS_IN_GCLIST) == 0) { \ + if (((thrd)->tlflags & TLFLAGS_IN_GCLIST) == 0) { \ TAILQ_INSERT_HEAD(&_thread_gc_list, thrd, gcle);\ - (thrd)->flags |= THR_FLAGS_IN_GCLIST; \ + (thrd)->tlflags |= TLFLAGS_IN_GCLIST; \ _gc_count++; \ } \ } while (0) #define THR_GCLIST_REMOVE(thrd) do { \ - if (((thrd)->flags & THR_FLAGS_IN_GCLIST) != 0) { \ + if (((thrd)->tlflags & TLFLAGS_IN_GCLIST) != 0) { \ TAILQ_REMOVE(&_thread_gc_list, thrd, gcle); \ - (thrd)->flags &= ~THR_FLAGS_IN_GCLIST; \ + (thrd)->tlflags &= ~TLFLAGS_IN_GCLIST; \ _gc_count--; \ } \ } while (0)