How to walk through the tasklist ?
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?
Signature · 2 lines
Regards, Stephan
Quoted 16 lines · Stephan von Krawczynski
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);
Quoted 1 line
But since
tasklist_lockis gone this is not safe any longer. So, what can I do?
How about for_each_process?
Jan