diff options
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r-- | sys/kern/kern_synch.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index d2c6acc..d84c64f 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -195,9 +195,11 @@ msleep(ident, mtx, priority, wmesg, timo) /* * Adjust this thread's priority. */ - mtx_lock_spin(&sched_lock); - sched_prio(td, priority & PRIMASK); - mtx_unlock_spin(&sched_lock); + if ((priority & PRIMASK) != 0) { + mtx_lock_spin(&sched_lock); + sched_prio(td, priority & PRIMASK); + mtx_unlock_spin(&sched_lock); + } if (timo && catch) rval = sleepq_timedwait_sig(ident); |