* Detecting runnable process?
@ 2010-10-05 1:39 Philip Wernersbach
2010-10-05 11:59 ` Américo Wang
0 siblings, 1 reply; 2+ messages in thread
From: Philip Wernersbach @ 2010-10-05 1:39 UTC (permalink / raw)
To: linux-kernel
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?
-Phil
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Detecting runnable process?
2010-10-05 1:39 Detecting runnable process? Philip Wernersbach
@ 2010-10-05 11:59 ` Américo Wang
0 siblings, 0 replies; 2+ messages in thread
From: Américo Wang @ 2010-10-05 11:59 UTC (permalink / raw)
To: Philip Wernersbach; +Cc: linux-kernel
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-05 11:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-05 1:39 Detecting runnable process? Philip Wernersbach
2010-10-05 11:59 ` Américo Wang
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®