summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_resource.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r--sys/kern/kern_resource.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index 0a36772..cccb040 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -488,8 +488,9 @@ rtp_to_pri(struct rtprio *rtp, struct thread *td)
sched_class(td, rtp->type); /* XXX fix */
oldpri = td->td_user_pri;
sched_user_prio(td, newpri);
- if (curthread == td)
- sched_prio(curthread, td->td_user_pri); /* XXX dubious */
+ if (td->td_user_pri != oldpri && (td == curthread ||
+ td->td_priority == oldpri || td->td_user_pri >= PRI_MAX_REALTIME))
+ sched_prio(td, td->td_user_pri);
if (TD_ON_UPILOCK(td) && oldpri != newpri) {
critical_enter();
thread_unlock(td);
OpenPOWER on IntegriCloud