From fb29c3e0838171ce83aade444ee73f733b51a161 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 23 Jan 2001 20:50:40 +0000 Subject: [PATCH] Protect calcru() with sched_lock. --- sys/compat/linux/linux_misc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 86c14d18dc3f..10eaa6ebebbc 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -654,7 +654,9 @@ linux_times(struct proc *p, struct linux_times_args *args) #ifdef DEBUG printf("Linux-emul(%ld): times(*)\n", (long)p->p_pid); #endif + mtx_enter(&sched_lock, MTX_SPIN); calcru(p, &ru.ru_utime, &ru.ru_stime, NULL); + mtx_exit(&sched_lock, MTX_SPIN); tms.tms_utime = CONVTCK(ru.ru_utime); tms.tms_stime = CONVTCK(ru.ru_stime);