When changing the user priority of a thread, change the real priority

in addition to the user priority for threads whose current real priority
is equal to the previous user priority or if the new priority is a
real-time priority.  This allows priority changes of other threads to
have an immediate effect.

MFC after:	2 weeks
This commit is contained in:
John Baldwin 2011-12-02 19:59:46 +00:00
parent 53aaf50a19
commit 593dd43eee
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=228207

View File

@ -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);