> p_p->ps_threads (and p_thr_link) can only be modified by threads in
> this process.  The result is that the test here can't claim the
> process is single-threaded when it's multi-threaded.  (An "is MT"
> result can go stale if there's no locking and the only other thread in
> the process exits, but that's generally not an issue.)
>
> If you really need to walk the p_p->ps_threads list, then you
> currently need the kernel lock to keep the threads in it from
> disappearing.

The proposed diff only peeks at the head of the list. But you're right,
the other code paths doing this (peek instead of full traversal) seem to
be under KERNEL_LOCK already.

Reply via email to