diff options
author | davidxu <davidxu@FreeBSD.org> | 2007-12-11 08:25:36 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2007-12-11 08:25:36 +0000 |
commit | 3695a7888976774d0e42b137f3ffa7d6f8aa6519 (patch) | |
tree | db8a9074c62e65619a0ea9e604c0544a7ed3ac32 /sys/kern/sched_4bsd.c | |
parent | 50439b0991ca4d4578f2860fd70d8ac7a4e45adc (diff) | |
download | FreeBSD-src-3695a7888976774d0e42b137f3ffa7d6f8aa6519.zip FreeBSD-src-3695a7888976774d0e42b137f3ffa7d6f8aa6519.tar.gz |
Fix LOR of thread lock and umtx's priority propagation mutex due
to the reworking of scheduler lock.
MFC: after 3 days
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 |