Protect p_swtime with the sched_lock.

This commit is contained in:
jhb 2003-04-22 19:48:25 +00:00
parent cfedd4c7d6
commit 8c172a3498

View File

@ -1138,7 +1138,9 @@ sched_pctcpu(struct kse *ke)
pctcpu = (FSCALE * ((FSCALE * rtick)/realstathz)) >> FSHIFT;
}
mtx_lock_spin(&sched_lock);
ke->ke_proc->p_swtime = ke->ke_ltick - ke->ke_ftick;
mtx_unlock_spin(&sched_lock);
return (pctcpu);
}