diff options
author | dim <dim@FreeBSD.org> | 2010-12-09 22:01:15 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2010-12-09 22:01:15 +0000 |
commit | a3786f65f1e2fa3a4e925fdb4b2b5544b9021bf9 (patch) | |
tree | 5f0a24f71baa3176c75a20a51a9e20a22c75426c /sys/kern/kern_umtx.c | |
parent | ad01c620333d05c430d583ee40647e396be1ab91 (diff) | |
parent | 12dd9eb8e940c48f9fc30dbc137071b4fe5caead (diff) | |
download | FreeBSD-src-a3786f65f1e2fa3a4e925fdb4b2b5544b9021bf9.zip FreeBSD-src-a3786f65f1e2fa3a4e925fdb4b2b5544b9021bf9.tar.gz |
Sync: merge r216133 through r216338 from ^/head.
Diffstat (limited to 'sys/kern/kern_umtx.c')
-rw-r--r-- | sys/kern/kern_umtx.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 43570ce..e7b9b32 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -1407,17 +1407,19 @@ umtx_propagate_priority(struct thread *td) for (;;) { td = pi->pi_owner; - if (td == NULL) + if (td == NULL || td == curthread) return; MPASS(td->td_proc != NULL); MPASS(td->td_proc->p_magic == P_MAGIC); - if (UPRI(td) <= pri) - return; - thread_lock(td); - sched_lend_user_prio(td, pri); + if (td->td_lend_user_pri > pri) + sched_lend_user_prio(td, pri); + else { + thread_unlock(td); + break; + } thread_unlock(td); /* @@ -3587,8 +3589,8 @@ umtx_thread_cleanup(struct thread *td) pi->pi_owner = NULL; TAILQ_REMOVE(&uq->uq_pi_contested, pi, pi_link); } + mtx_unlock_spin(&umtx_lock); thread_lock(td); - td->td_flags &= ~TDF_UBORROWING; + sched_unlend_user_prio(td, PRI_MAX); thread_unlock(td); - mtx_unlock_spin(&umtx_lock); } |