1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Add some locking in for a few proc and thread fields.

This commit is contained in:
John Baldwin 2003-04-17 22:25:35 +00:00
parent bb0e8070fd
commit e674d80790
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113629
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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);
}