From owner-svn-src-all@FreeBSD.ORG Mon Oct 25 13:13:17 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 2D4351065670; Mon, 25 Oct 2010 13:13:17 +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 1BCAA8FC1A; Mon, 25 Oct 2010 13:13:17 +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 o9PDDHNg065931; Mon, 25 Oct 2010 13:13:17 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PDDG6C065929; Mon, 25 Oct 2010 13:13:17 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010251313.o9PDDG6C065929@svn.freebsd.org> From: David Xu Date: Mon, 25 Oct 2010 13:13:16 +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: r214337 - head/sys/kern 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: Mon, 25 Oct 2010 13:13:17 -0000 Author: davidxu Date: Mon Oct 25 13:13:16 2010 New Revision: 214337 URL: http://svn.freebsd.org/changeset/base/214337 Log: Use function tdfind() to find a thread. Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Mon Oct 25 13:01:19 2010 (r214336) +++ head/sys/kern/kern_cpuset.c Mon Oct 25 13:13:16 2010 (r214337) @@ -416,19 +416,10 @@ cpuset_which(cpuwhich_t which, id_t id, td = curthread; break; } - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - PROC_LOCK(p); - FOREACH_THREAD_IN_PROC(p, td) - if (td->td_tid == id) - break; - if (td != NULL) - break; - PROC_UNLOCK(p); - } - sx_sunlock(&allproc_lock); + td = tdfind(id, -1); if (td == NULL) return (ESRCH); + p = td->td_proc; break; case CPU_WHICH_CPUSET: if (id == -1) {