mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Protect p_swtime with the sched_lock.
This commit is contained in:
parent
a6f37ac9d6
commit
828e7683bf
1 changed files with 2 additions and 0 deletions
|
|
@ -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 a new issue