Lock curlwp when updating the start time.
This commit is contained in:
parent
0239b151ae
commit
a67091837e
@ -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,
|
* Copyright (c)2002, 2006, 2007 YAMAMOTO Takashi,
|
||||||
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
__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 <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/cpu.h>
|
#include <sys/cpu.h>
|
||||||
@ -48,7 +48,9 @@ idle_loop(void *dummy)
|
|||||||
struct lwp *l = curlwp;
|
struct lwp *l = curlwp;
|
||||||
|
|
||||||
/* Update start time for this thread. */
|
/* Update start time for this thread. */
|
||||||
|
lwp_lock(l);
|
||||||
microtime(&l->l_stime);
|
microtime(&l->l_stime);
|
||||||
|
lwp_unlock(l);
|
||||||
|
|
||||||
KERNEL_UNLOCK_ALL(l, NULL);
|
KERNEL_UNLOCK_ALL(l, NULL);
|
||||||
l->l_stat = LSONPROC;
|
l->l_stat = LSONPROC;
|
||||||
|
Loading…
Reference in New Issue
Block a user