Date: Mon, 25 Oct 2010 13:13:16 +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: r214337 - head/sys/kern Message-ID: <201010251313.o9PDDG6C065929@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010251313.o9PDDG6C065929>