The typeof() cast looks weird. I had to think twice to make sense of it.
> Good point. It looks like find_task_by_pid() needs to be protected
> by a read_lock(&tasklist_lock). The timers are linked into
> a list so they will be removed when the process exits.
> Any sugestions on a code example that does this right are
> welcome:-)
/proc does it by increasing the count in the struct page of the stack
page of the process. exit() knows about that. Example is somewhere in fs/proc/
The increase has to be done inside the lock. As always one has to be careful
with lock ordering.
The standard way is to just hold the read lock of the tasklist.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/