From 0fe78c3128864d128b2b10153b8d533ff8c00375 Mon Sep 17 00:00:00 2001 From: David Leonard Date: Thu, 25 Nov 1999 07:01:48 +0000 Subject: sync with FreeBSD --- lib/libpthread/uthread/uthread_setschedparam.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/libpthread/uthread/uthread_setschedparam.c') diff --git a/lib/libpthread/uthread/uthread_setschedparam.c b/lib/libpthread/uthread/uthread_setschedparam.c index 0024460c003..26e1b61d017 100644 --- a/lib/libpthread/uthread/uthread_setschedparam.c +++ b/lib/libpthread/uthread/uthread_setschedparam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_setschedparam.c,v 1.1 1999/05/26 00:18:25 d Exp $ */ +/* $OpenBSD: uthread_setschedparam.c,v 1.2 1999/11/25 07:01:43 d Exp $ */ /* * Copyright (c) 1998 Daniel Eischen . * All rights reserved. @@ -30,6 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD: uthread_setschedparam.c,v 1.3 1999/08/28 00:03:47 peter Exp $ */ #include #include @@ -51,10 +52,10 @@ pthread_setschedparam(pthread_t pthread, int policy, const struct sched_param *p /* Find the thread in the list of active threads: */ else if ((ret = _find_thread(pthread)) == 0) { /* - * Guard against being preempted by a scheduling - * signal: + * Defer signals to protect the scheduling queues from + * access by the signal handler: */ - _thread_kern_sched_defer(); + _thread_kern_sig_defer(); if (param->sched_priority != pthread->base_priority) { /* @@ -62,8 +63,7 @@ pthread_setschedparam(pthread_t pthread, int policy, const struct sched_param *p * queue before any adjustments are made to its * active priority: */ - if ((pthread != _thread_run) && - (pthread->state == PS_RUNNING)) { + if ((pthread->flags & PTHREAD_FLAGS_IN_PRIOQ) != 0) { in_readyq = 1; old_prio = pthread->active_priority; PTHREAD_PRIOQ_REMOVE(pthread); @@ -104,10 +104,10 @@ pthread_setschedparam(pthread_t pthread, int policy, const struct sched_param *p pthread->attr.sched_policy = policy; /* - * Renable preemption and yield if a scheduling signal - * arrived while in the critical region: + * Undefer and handle pending signals, yielding if + * necessary: */ - _thread_kern_sched_undefer(); + _thread_kern_sig_undefer(); } return(ret); } -- cgit v1.2.3