summaryrefslogtreecommitdiff
path: root/sys/kern/kern_resource.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2001-01-24 11:06:39 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2001-01-24 11:06:39 +0000
commit7871c121ff5bb4b08a1124fda4b4d2383c123344 (patch)
tree25428d95686ebae3ba1b0365ed5f1c6ed9838903 /sys/kern/kern_resource.c
parent42a4ed997549140932b292b53d89d112aa08b18b (diff)
Notes
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r--sys/kern/kern_resource.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index e67ee798f92c..e29c273250bb 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -513,6 +513,7 @@ calcru(p, up, sp, ip)
int s;
struct timeval tv;
+ mtx_assert(&sched_lock, MA_OWNED);
/* XXX: why spl-protect ? worst case is an off-by-one report */
s = splstatclock();
ut = p->p_uticks;
@@ -609,7 +610,9 @@ getrusage(p, uap)
case RUSAGE_SELF:
rup = &p->p_stats->p_ru;
+ mtx_enter(&sched_lock, MTX_SPIN);
calcru(p, &rup->ru_utime, &rup->ru_stime, NULL);
+ mtx_exit(&sched_lock, MTX_SPIN);
break;
case RUSAGE_CHILDREN: