summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread/thr_attr.c')
-rw-r--r--lib/libthr/thread/thr_attr.c12
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;
OpenPOWER on IntegriCloud