From a67091837e9de4be5443a2c50dfdeb02273c769e Mon Sep 17 00:00:00 2001 From: ad Date: Thu, 15 Nov 2007 20:12:25 +0000 Subject: [PATCH] Lock curlwp when updating the start time. --- sys/kern/kern_idle.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_idle.c b/sys/kern/kern_idle.c index a76193f4afa8..1bfa4cd70652 100644 --- a/sys/kern/kern_idle.c +++ b/sys/kern/kern_idle.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_idle.c,v 1.8 2007/11/13 22:14:35 ad Exp $ */ +/* $NetBSD: kern_idle.c,v 1.9 2007/11/15 20:12:25 ad Exp $ */ /*- * Copyright (c)2002, 2006, 2007 YAMAMOTO Takashi, @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: kern_idle.c,v 1.8 2007/11/13 22:14:35 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_idle.c,v 1.9 2007/11/15 20:12:25 ad Exp $"); #include #include @@ -48,7 +48,9 @@ idle_loop(void *dummy) struct lwp *l = curlwp; /* Update start time for this thread. */ + lwp_lock(l); microtime(&l->l_stime); + lwp_unlock(l); KERNEL_UNLOCK_ALL(l, NULL); l->l_stat = LSONPROC;