diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-07-12 06:13:18 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-07-12 06:13:18 +0000 |
commit | ecacf536b0f70b9b9579910c7d6dd8b5a9608136 (patch) | |
tree | f3ebabe7f0c598fbcd24fc997f7310e276d3efb0 /lib/libthr/thread/thr_attr.c | |
parent | 3117fa3da4d89744ddfe45c3ac759ab430bd2950 (diff) | |
download | FreeBSD-src-ecacf536b0f70b9b9579910c7d6dd8b5a9608136.zip FreeBSD-src-ecacf536b0f70b9b9579910c7d6dd8b5a9608136.tar.gz |
Use kernel facilities to support real-time scheduling.
Diffstat (limited to 'lib/libthr/thread/thr_attr.c')
-rw-r--r-- | lib/libthr/thread/thr_attr.c | 12 |
1 files changed, 10 insertions, 2 deletions
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; |