From owner-p4-projects@FreeBSD.ORG Mon Oct 2 04:58:49 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A462516A412; Mon, 2 Oct 2006 04:58:49 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 51EA316A403 for ; Mon, 2 Oct 2006 04:58:49 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 036F343D45 for ; Mon, 2 Oct 2006 04:58:49 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k924wmPJ078020 for ; Mon, 2 Oct 2006 04:58:48 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k924wm4n078017 for perforce@freebsd.org; Mon, 2 Oct 2006 04:58:48 GMT (envelope-from jb@freebsd.org) Date: Mon, 2 Oct 2006 04:58:48 GMT Message-Id: <200610020458.k924wm4n078017@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 107070 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2006 04:58:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=107070 Change 107070 by jb@jb_freebsd7 on 2006/10/02 04:57:57 Catch up with davidxu's libthr changes. This file is a copy of thr_create.c. The name change is required to avoid a clash with the syscall of the same name when libthr code is built into libc. Affected files ... .. //depot/projects/dtrace/src/lib/libthr/thread/pthread_create.c#2 edit Differences ... ==== //depot/projects/dtrace/src/lib/libthr/thread/pthread_create.c#2 (text+ko) ==== @@ -24,11 +24,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/lib/libthr/thread/thr_create.c,v 1.32 2006/07/13 22:45:19 davidxu Exp $ + * $FreeBSD: src/lib/libthr/thread/thr_create.c,v 1.34 2006/09/21 04:21:30 davidxu Exp $ */ #include "namespace.h" #include +#include #include #include #include @@ -50,7 +51,8 @@ { struct pthread *curthread, *new_thread; struct thr_param param; - struct thr_sched_param sched_param; + struct sched_param sched_param; + struct rtprio rtp; int ret = 0, locked, create_suspended; sigset_t set, oset; @@ -107,6 +109,7 @@ PTHREAD_CANCEL_DEFERRED; /* Initialize the mutex queue: */ TAILQ_INIT(&new_thread->mutexq); + TAILQ_INIT(&new_thread->pp_mutexq); /* Initialise hooks in the thread structure: */ if (new_thread->attr.suspend == THR_CREATE_SUSPENDED) { @@ -143,12 +146,12 @@ if (new_thread->attr.flags & PTHREAD_SCOPE_SYSTEM) param.flags |= THR_SYSTEM_SCOPE; if (new_thread->attr.sched_inherit == PTHREAD_INHERIT_SCHED) - param.sched_param = NULL; + param.rtp = NULL; else { - param.sched_param = &sched_param; - param.sched_param_size = sizeof(sched_param); - sched_param.policy = new_thread->attr.sched_policy; - sched_param.param.sched_priority = new_thread->attr.prio; + sched_param.sched_priority = new_thread->attr.prio; + _schedparam_to_rtp(new_thread->attr.sched_policy, + &sched_param, &rtp); + param.rtp = &rtp; } /* Schedule the new thread. */