diff options
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r-- | sys/kern/sched_4bsd.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 6278126..596102f 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -892,24 +892,12 @@ sched_lend_user_prio(struct thread *td, u_char prio) { THREAD_LOCK_ASSERT(td, MA_OWNED); - if (prio < td->td_lend_user_pri) - td->td_lend_user_pri = prio; - if (prio < td->td_user_pri) - td->td_user_pri = prio; -} - -void -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; td->td_lend_user_pri = prio; - if (prio > base_pri) - td->td_user_pri = base_pri; - else - td->td_user_pri = prio; + td->td_user_pri = min(prio, td->td_base_user_pri); + if (td->td_priority > td->td_user_pri) + sched_prio(td, td->td_user_pri); + else if (td->td_priority != td->td_user_pri) + td->td_flags |= TDF_NEEDRESCHED; } void |