From: "Américo Wang" <xiyou.wangcong@gmail.com>
To: Philip Wernersbach <philip.wernersbach@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Detecting runnable process?
Date: Tue, 5 Oct 2010 19:59:58 +0800 [thread overview]
Message-ID: <20101005115958.GJ5170@cr0.nay.redhat.com> (raw)
In-Reply-To: <AANLkTimKpVR5UVYLetwt=S4PSkMEJTBpUk7Q-o=ha_ds@mail.gmail.com>
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.
prev parent reply other threads:[~2010-10-05 11:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 1:39 Philip Wernersbach
2010-10-05 11:59 ` Américo Wang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101005115958.GJ5170@cr0.nay.redhat.com \
--to=xiyou.wangcong@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=philip.wernersbach@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®