summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_thr.c
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2004-07-12 15:28:31 +0000
committermtm <mtm@FreeBSD.org>2004-07-12 15:28:31 +0000
commit8e8f80bd23b814fd62dfaa9cad441cee760e63d3 (patch)
tree76b0aee1d4081a4c01a07590c3b321c577dff63d /sys/kern/kern_thr.c
parentfae9d5166b05adb387f7ba91b99498b29b02792f (diff)
downloadFreeBSD-src-8e8f80bd23b814fd62dfaa9cad441cee760e63d3.zip
FreeBSD-src-8e8f80bd23b814fd62dfaa9cad441cee760e63d3.tar.gz
writers must hold both sched_lock and the process lock; therefore, readers
need only obtain the process lock.
Diffstat (limited to 'sys/kern/kern_thr.c')
-rw-r--r--sys/kern/kern_thr.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c
index d1b5d3f..856e2dc 100644
--- a/sys/kern/kern_thr.c
+++ b/sys/kern/kern_thr.c
@@ -280,13 +280,10 @@ thr_suspend(struct thread *td, struct thr_suspend_args *uap)
hz = tvtohz(&tv);
}
PROC_LOCK(td->td_proc);
- mtx_lock_spin(&sched_lock);
- if ((td->td_flags & TDF_THRWAKEUP) == 0) {
- mtx_unlock_spin(&sched_lock);
+ if ((td->td_flags & TDF_THRWAKEUP) == 0)
error = msleep((void *)td, &td->td_proc->p_mtx,
td->td_priority | PCATCH, "lthr", hz);
- mtx_lock_spin(&sched_lock);
- }
+ mtx_lock_spin(&sched_lock);
td->td_flags &= ~TDF_THRWAKEUP;
mtx_unlock_spin(&sched_lock);
PROC_UNLOCK(td->td_proc);
OpenPOWER on IntegriCloud