From ecacf536b0f70b9b9579910c7d6dd8b5a9608136 Mon Sep 17 00:00:00 2001 From: davidxu Date: Wed, 12 Jul 2006 06:13:18 +0000 Subject: Use kernel facilities to support real-time scheduling. --- lib/libthr/thread/thr_attr.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/libthr/thread/thr_attr.c') diff --git a/lib/libthr/thread/thr_attr.c b/lib/libthr/thread/thr_attr.c index 24dd064..1400cc6 100644 --- a/lib/libthr/thread/thr_attr.c +++ b/lib/libthr/thread/thr_attr.c @@ -434,9 +434,17 @@ _pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *para policy = (*attr)->sched_policy; - if (param->sched_priority < _thr_priorities[policy-1].pri_min || - param->sched_priority > _thr_priorities[policy-1].pri_max) + if (policy == SCHED_FIFO || policy == SCHED_RR) { + if (param->sched_priority < _thr_priorities[policy-1].pri_min || + param->sched_priority > _thr_priorities[policy-1].pri_max) return (ENOTSUP); + } else { + /* + * Ignore it for SCHED_OTHER now, patches for glib ports + * are wrongly using M:N thread library's internal macro + * THR_MIN_PRIORITY and THR_MAX_PRIORITY. + */ + } (*attr)->prio = param->sched_priority; -- cgit v1.1