--- src/sys/kern/kern_fork.c 2006/05/24 18:59:48 1.49 +++ src/sys/kern/kern_fork.c 2006/05/29 22:57:22 1.50 @@ -434,11 +434,16 @@ fork1(struct lwp *lp1, int flags, struct * Inherit the scheduler and initialize scheduler-related fields. * Set cpbase to the last timeout that occured (not the upcoming * timeout). + * + * A critical section is required since a timer IPI can update + * scheduler specific data. */ + crit_enter(); p2->p_usched = p1->p_usched; lp2->lwp_cpbase = mycpu->gd_schedclock.time - mycpu->gd_schedclock.periodic; p2->p_usched->heuristic_forking(&p1->p_lwp, lp2); + crit_exit(); /* * This begins the section where we must prevent the parent