* How to walk through the tasklist ?
@ 2007-04-24 12:58 Stephan von Krawczynski
2007-04-24 13:21 ` Jan Engelhardt
0 siblings, 1 reply; 2+ messages in thread
From: Stephan von Krawczynski @ 2007-04-24 12:58 UTC (permalink / raw)
To: linux-kernel
Hello all,
can anyone give me a short hint how walking through the tasklist in a device
driver can be achieved nowadays. In ancient pre-20 times you could simply:
read_lock(&tasklist_lock);
p=current;
do {
if (p->pid==pid) {
read_unlock(&tasklist_lock);
/* found */
}
p=p->next_task;
} while (p!=current);
read_unlock(&tasklist_lock);
But since tasklist_lock is gone this is not safe any longer. So, what can I do?
--
Regards,
Stephan
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: How to walk through the tasklist ?
2007-04-24 12:58 How to walk through the tasklist ? Stephan von Krawczynski
@ 2007-04-24 13:21 ` Jan Engelhardt
0 siblings, 0 replies; 2+ messages in thread
From: Jan Engelhardt @ 2007-04-24 13:21 UTC (permalink / raw)
To: Stephan von Krawczynski; +Cc: linux-kernel
On Apr 24 2007 14:58, Stephan von Krawczynski wrote:
>Hello all,
>
>can anyone give me a short hint how walking through the tasklist in a device
>driver can be achieved nowadays. In ancient pre-20 times you could simply:
>
> read_lock(&tasklist_lock);
> p=current;
> do {
> if (p->pid==pid) {
> read_unlock(&tasklist_lock);
> /* found */
> }
> p=p->next_task;
> } while (p!=current);
> read_unlock(&tasklist_lock);
>
>But since tasklist_lock is gone this is not safe any longer. So, what can I do?
How about for_each_process?
Jan
--
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-04-24 13:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-24 12:58 How to walk through the tasklist ? Stephan von Krawczynski
2007-04-24 13:21 ` Jan Engelhardt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.