Date: Mon, 2 Oct 2006 04:58:48 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 107070 for review Message-ID: <200610020458.k924wm4n078017@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <sys/types.h> +#include <sys/rtprio.h> #include <sys/signalvar.h> #include <errno.h> #include <stdlib.h> @@ -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. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610020458.k924wm4n078017>