On Sun, 14 Dec 2003, Ingo Molnar wrote:>> the code is a bit ugly, but it's necessary - a parent can decide _after_> starting the child that it wants to detach it. (by setting SIGCHLD to> SIG_IGN. The testcase doesnt do this.) So the only place where we can> detect the detached-ness of a process is in do_notify_parent().

Hmm.. What if "leader->exit_signal" was -1 already _before_ we call"do_notify_parent()"? In that case we'd never call "do_notify_parent()"for the leader at all, and we would also not release it outselves, the wayyou've done the test.

Or is that case impossible to trigger? Looks a bit like that. But if it_is_ impossible to trigger (ie exit_signal cannot be -1 for a threadleader), then why does the current code test for "&& leader->exit_signal!= -1)" at all?

That code looks fragile as hell. I think you fixed a bug and it might bethe absolutely proper fix, but I'd be happier about it if it was moreobvious what the rules are and _why_ that is the only case that matters..