diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-04-27 08:18:23 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-04-27 08:18:23 +0000 |
commit | 66d0fee031ed44d54ee9e1a183fbe75c37a6e158 (patch) | |
tree | daa71c55e66d8720e95d00de6f5673a23b90bfa8 /lib/libthr/thread/thr_setschedparam.c | |
parent | e4cefd49df59b5e0ac6b8c1791cf554240bae189 (diff) | |
download | FreeBSD-src-66d0fee031ed44d54ee9e1a183fbe75c37a6e158.zip FreeBSD-src-66d0fee031ed44d54ee9e1a183fbe75c37a6e158.tar.gz |
- 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.
Diffstat (limited to 'lib/libthr/thread/thr_setschedparam.c')
-rw-r--r-- | lib/libthr/thread/thr_setschedparam.c | 7 |
1 files changed, 3 insertions, 4 deletions
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. |