diff options
| author | 2014-07-04 05:58:30 +0000 | |
|---|---|---|
| committer | 2014-07-04 05:58:30 +0000 | |
| commit | 644b47884b319d456d6792dca9dee3a804d68b3b (patch) | |
| tree | dfe947066c6d6a96f92e5a50bc0b470a131b7f99 /sys/kern/kern_exit.c | |
| parent | Clean up messages related to missing arguments. (diff) | |
| download | wireguard-openbsd-644b47884b319d456d6792dca9dee3a804d68b3b.tar.xz wireguard-openbsd-644b47884b319d456d6792dca9dee3a804d68b3b.zip | |
Track whether a process is a zombie or not yet fully built via flags
PS_{ZOMBIE,EMBRYO} on the process instead of peeking into the process's
thread data. This eliminates the need for the thread-level SDEAD state.
Change kvm_getprocs() (both the sysctl() and kvm backends) to report the
"most active" scheduler state for the process's threads.
tweaks kettenis@
feedback and ok matthew@
Diffstat (limited to 'sys/kern/kern_exit.c')
| -rw-r--r-- | sys/kern/kern_exit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 97d1a76b3f2..4d1d8445c2b 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exit.c,v 1.143 2014/06/11 20:39:18 matthew Exp $ */ +/* $OpenBSD: kern_exit.c,v 1.144 2014/07/04 05:58:30 guenther Exp $ */ /* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */ /* @@ -460,7 +460,7 @@ reaper(void) if ((pr->ps_flags & PS_NOZOMBIE) == 0) { /* Process is now a true zombie. */ - p->p_stat = SZOMB; + atomic_setbits_int(&pr->ps_flags, PS_ZOMBIE); prsignal(pr->ps_pptr, SIGCHLD); /* Wake up the parent so it can get exit status. */ @@ -528,7 +528,7 @@ loop: continue; nfound++; - if (p->p_stat == SZOMB) { + if (pr->ps_flags & PS_ZOMBIE) { retval[0] = p->p_pid; if (statusp != NULL) |
