> - please don't introduce a new pointer, just use the old one. There
> appears to be no cases where you want to have different pointers
> anyway.
There are: suppose that you want to implement the int cfork(int* pid)
function, which returns the pid in *pid in the parent vm, in a
multithreaded application.
The child tid pointer must be set to the current thread tid field,
because the thread structure is going to be reused.
However, that field contains the tid of the forking thread in the parent
process and must not be modified. So a different pointer is needed.
You could avoid the additional pointer by letting
child_tidptr = (!(flags & CLONE_VM) && current->user_tid) ?
current->user_tid : parent_tidptr;
but this forces the thread library to reuse the thread structure when
forking.
This archive was generated by hypermail 2b29 : Sat Nov 23 2002 - 22:00:21 EST