[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20101005115958.GJ5170@cr0.nay.redhat.com>
Date: Tue, 5 Oct 2010 19:59:58 +0800
From: Américo Wang <xiyou.wangcong@...il.com>
To: Philip Wernersbach <philip.wernersbach@...il.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: Detecting runnable process?
On Mon, Oct 04, 2010 at 09:39:16PM -0400, Philip Wernersbach wrote:
>I'm writing some kernel code that given a task's task_struct must
>decide if it is runnable, and hasn't crashed or exited. So far here's
>what I've come up with:
>
>struct task_struct *my_task;
>... snip ...
>if(likely(my_task != NULL && pid_alive(my_task) == true)) { return my_task; }
>
>Is this correct?
>
Yes to me, you can also check the functions which call pid_alive() in kernel.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists