Re: [PATCH] use pid_alive in proc_pid_status

From: Ingo Molnar
Date: Mon Nov 29 2004 - 04:42:59 EST



* Andrew Morton <akpm@xxxxxxxx> wrote:

> > +int pid_alive(struct task_struct *p)
> > +{
> > + return p->pids[PIDTYPE_PID].nr != 0;
> > +}
>
> Can we not simply test p->exit_state? That's already done in quite a
> few places and making things consistent would be nice.

as long as it's accessed from under the tasklist_lock, it ought to be
fine to check for p->exit_state != EXIT_DEAD and dereference
p->group_leader afterwards.

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/