summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_time.c')
-rw-r--r--sys/kern/kern_time.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 8634c8a..e220cd6 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -213,13 +213,17 @@ kern_clock_gettime(struct thread *td, clockid_t clock_id, struct timespec *ats)
break;
case CLOCK_VIRTUAL:
PROC_LOCK(p);
+ PROC_SLOCK(p);
calcru(p, &user, &sys);
+ PROC_SUNLOCK(p);
PROC_UNLOCK(p);
TIMEVAL_TO_TIMESPEC(&user, ats);
break;
case CLOCK_PROF:
PROC_LOCK(p);
+ PROC_SLOCK(p);
calcru(p, &user, &sys);
+ PROC_SUNLOCK(p);
PROC_UNLOCK(p);
timevaladd(&user, &sys);
TIMEVAL_TO_TIMESPEC(&user, ats);
OpenPOWER on IntegriCloud