Protect p_swtime with the sched_lock.
This commit is contained in:
parent
cfedd4c7d6
commit
8c172a3498
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user