From 66d0fee031ed44d54ee9e1a183fbe75c37a6e158 Mon Sep 17 00:00:00 2001 From: davidxu Date: Thu, 27 Apr 2006 08:18:23 +0000 Subject: - Use same priority range returned by kernel's sched_get_priority_min() and sched_get_priority_max() syscalls. - Remove unused fields from structure pthread_attr. --- lib/libthr/thread/thr_setschedparam.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/libthr/thread/thr_setschedparam.c') diff --git a/lib/libthr/thread/thr_setschedparam.c b/lib/libthr/thread/thr_setschedparam.c index 9cbebbf..eba5017 100644 --- a/lib/libthr/thread/thr_setschedparam.c +++ b/lib/libthr/thread/thr_setschedparam.c @@ -55,8 +55,8 @@ _pthread_setschedparam(pthread_t pthread, int policy, if ((param == NULL) || (policy < SCHED_FIFO) || (policy > SCHED_RR)) { ret = EINVAL; - } else if ((param->sched_priority < THR_MIN_PRIORITY) || - (param->sched_priority > THR_MAX_PRIORITY)) { + } else if (param->sched_priority < _thr_priorities[policy-1].pri_min || + param->sched_priority > _thr_priorities[policy-1].pri_max) { ret = ENOTSUP; } else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0)) == 0) { @@ -74,8 +74,7 @@ _pthread_setschedparam(pthread_t pthread, int policy, /* Set the scheduling policy: */ pthread->attr.sched_policy = policy; - if (param->sched_priority == - THR_BASE_PRIORITY(pthread->base_priority)) + if (param->sched_priority == pthread->base_priority) /* * There is nothing to do; unlock the threads * scheduling queue. -- cgit v1.1