diff options
author | jhb <jhb@FreeBSD.org> | 2003-04-17 22:25:35 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-04-17 22:25:35 +0000 |
commit | 313b87d41a1d51ef3fe051877963244bd707f52d (patch) | |
tree | e370fcb508245da455f7eff3634ad080e17a4a17 | |
parent | ab40c1468e69d8fda6ba05450835eadb678218b6 (diff) | |
download | FreeBSD-src-313b87d41a1d51ef3fe051877963244bd707f52d.zip FreeBSD-src-313b87d41a1d51ef3fe051877963244bd707f52d.tar.gz |
Add some locking in for a few proc and thread fields.
-rw-r--r-- | sys/kern/kern_idle.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_intr.c | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/kern_idle.c b/sys/kern/kern_idle.c index 4d57749..a3a9495 100644 --- a/sys/kern/kern_idle.c +++ b/sys/kern/kern_idle.c @@ -61,11 +61,15 @@ idle_setup(void *dummy) if (error) panic("idle_setup: kthread_create error %d\n", error); + PROC_LOCK(p); p->p_flag |= P_NOLOAD; + mtx_lock_spin(&sched_lock); p->p_state = PRS_NORMAL; td = FIRST_THREAD_IN_PROC(p); td->td_state = TDS_CAN_RUN; - td->td_kse->ke_flags |= KEF_IDLEKSE; + td->td_kse->ke_flags |= KEF_IDLEKSE; + mtx_unlock_spin(&sched_lock); + PROC_UNLOCK(p); #ifdef SMP } #endif diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index 195977d..5a1a0c2 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -197,14 +197,15 @@ ithread_create(struct ithd **ithread, int vector, int flags, return (error); } td = FIRST_THREAD_IN_PROC(p); /* XXXKSE */ + mtx_lock_spin(&sched_lock); td->td_ksegrp->kg_pri_class = PRI_ITHD; td->td_priority = PRI_MAX_ITHD; TD_SET_IWAIT(td); + mtx_unlock_spin(&sched_lock); ithd->it_td = td; td->td_ithd = ithd; if (ithread != NULL) *ithread = ithd; - CTR2(KTR_INTR, "%s: created %s", __func__, ithd->it_name); return (0); } |