summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2002-09-07 01:48:53 +0000
committerjulian <julian@FreeBSD.org>2002-09-07 01:48:53 +0000
commitd191c82c92a3d2e93896cad3640f2cb611958d2b (patch)
tree3e17763bad209787e5313d7512d7b0a026150b35
parentec9cab8da4e70ca1743d080f88605c0a3caabb54 (diff)
downloadFreeBSD-src-d191c82c92a3d2e93896cad3640f2cb611958d2b.zip
FreeBSD-src-d191c82c92a3d2e93896cad3640f2cb611958d2b.tar.gz
fix misplaced schedlock
Submitted by: davidxu@freebsd.org
-rw-r--r--sys/kern/kern_kse.c2
-rw-r--r--sys/kern/kern_thread.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index 8b2b88c..87b0f12 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -742,9 +742,9 @@ thread_suspend_check(int return_instead)
psignal(p->p_pptr, SIGCHLD);
}
PROC_UNLOCK(p->p_pptr);
+ mtx_lock_spin(&sched_lock);
}
mtx_assert(&Giant, MA_NOTOWNED);
- mtx_lock_spin(&sched_lock);
p->p_suspcount++;
td->td_state = TDS_SUSPENDED;
TAILQ_INSERT_TAIL(&p->p_suspended, td, td_runq);
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 8b2b88c..87b0f12 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -742,9 +742,9 @@ thread_suspend_check(int return_instead)
psignal(p->p_pptr, SIGCHLD);
}
PROC_UNLOCK(p->p_pptr);
+ mtx_lock_spin(&sched_lock);
}
mtx_assert(&Giant, MA_NOTOWNED);
- mtx_lock_spin(&sched_lock);
p->p_suspcount++;
td->td_state = TDS_SUSPENDED;
TAILQ_INSERT_TAIL(&p->p_suspended, td, td_runq);
OpenPOWER on IntegriCloud