diff options
author | jhb <jhb@FreeBSD.org> | 2003-04-22 19:48:25 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-04-22 19:48:25 +0000 |
commit | 8c172a3498d91a8abd7141b374284ed6759b7e0b (patch) | |
tree | 2baba6d4b03dddbc144577b7d99eb12deb24eed0 /sys/kern/sched_ule.c | |
parent | cfedd4c7d621b4ce0f04cbf58a510ca40fd784b3 (diff) | |
download | FreeBSD-src-8c172a3498d91a8abd7141b374284ed6759b7e0b.zip FreeBSD-src-8c172a3498d91a8abd7141b374284ed6759b7e0b.tar.gz |
Protect p_swtime with the sched_lock.
Diffstat (limited to 'sys/kern/sched_ule.c')
-rw-r--r-- | sys/kern/sched_ule.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 433159b..1305527 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -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); } |