Need to call calcru while l->l_stat == LSONPROC

This commit is contained in:
dsl 2003-03-12 15:26:33 +00:00
parent 7b3b2ea783
commit 4f78d8c26a

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_exit.c,v 1.113 2003/03/05 11:40:55 dsl Exp $ */ /* $NetBSD: kern_exit.c,v 1.114 2003/03/12 15:26:33 dsl Exp $ */
/*- /*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -78,7 +78,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.113 2003/03/05 11:40:55 dsl Exp $"); __KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.114 2003/03/12 15:26:33 dsl Exp $");
#include "opt_ktrace.h" #include "opt_ktrace.h"
#include "opt_perfctrs.h" #include "opt_perfctrs.h"
@ -268,13 +268,6 @@ exit1(struct lwp *l, int rv)
if (p->p_emul->e_proc_exit) if (p->p_emul->e_proc_exit)
(*p->p_emul->e_proc_exit)(p); (*p->p_emul->e_proc_exit)(p);
/*
* NOTE: WE ARE NO LONGER ALLOWED TO SLEEP!
*/
p->p_stat = SDEAD;
p->p_nrlwps--;
l->l_stat = SDEAD;
/* /*
* Save exit status and final rusage info, adding in child rusage * Save exit status and final rusage info, adding in child rusage
* info and self times. * info and self times.
@ -286,6 +279,13 @@ exit1(struct lwp *l, int rv)
calcru(p, &p->p_ru->ru_utime, &p->p_ru->ru_stime, NULL); calcru(p, &p->p_ru->ru_utime, &p->p_ru->ru_stime, NULL);
ruadd(p->p_ru, &p->p_stats->p_cru); ruadd(p->p_ru, &p->p_stats->p_cru);
/*
* NOTE: WE ARE NO LONGER ALLOWED TO SLEEP!
*/
p->p_stat = SDEAD;
p->p_nrlwps--;
l->l_stat = SDEAD;
/* /*
* Remove proc from pidhash chain so looking it up won't * Remove proc from pidhash chain so looking it up won't
* work. Move it from allproc to zombproc, but do not yet * work. Move it from allproc to zombproc, but do not yet