diff options
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r-- | sys/kern/sched_4bsd.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 8a42143..f6e702e 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -762,14 +762,12 @@ sched_user_prio(struct thread *td, u_char prio) { u_char oldprio; + THREAD_LOCK_ASSERT(td, MA_OWNED); td->td_base_user_pri = prio; if (td->td_flags & TDF_UBORROWING && td->td_user_pri <= prio) return; oldprio = td->td_user_pri; td->td_user_pri = prio; - - if (TD_ON_UPILOCK(td) && oldprio != prio) - umtx_pi_adjust(td, oldprio); } void @@ -777,13 +775,10 @@ sched_lend_user_prio(struct thread *td, u_char prio) { u_char oldprio; + THREAD_LOCK_ASSERT(td, MA_OWNED); td->td_flags |= TDF_UBORROWING; - oldprio = td->td_user_pri; td->td_user_pri = prio; - - if (TD_ON_UPILOCK(td) && oldprio != prio) - umtx_pi_adjust(td, oldprio); } void @@ -791,12 +786,14 @@ sched_unlend_user_prio(struct thread *td, u_char prio) { u_char base_pri; + THREAD_LOCK_ASSERT(td, MA_OWNED); base_pri = td->td_base_user_pri; if (prio >= base_pri) { td->td_flags &= ~TDF_UBORROWING; sched_user_prio(td, base_pri); - } else + } else { sched_lend_user_prio(td, prio); + } } void |