Messages in this thread | | | From | Roland McGrath <> | Subject | Re: [PATCH 2/4] ptrace: simplify ptrace_exit()->ignoring_children() path | Date | Wed, 4 Feb 2009 17:09:51 -0800 (PST) |
| |
> ignoring_children() takes parent->sighand->siglock and checks > k_sigaction[SIGCHLD] atomically. But this buys nothing, we can't get > the "really" wrong result even if we race with sigaction(SIGCHLD). > If we read the "stale" sa_handler/sa_flags we can pretend it was > changed right after the check.
Agreed. There is no real synchronization anyway, since sigaction does not cause reaping of zombies already extant (and POSIX says it does not). All that really matters is that ignoring_children() never have a false-negative after sigaction has been called synchronously (i.e. earlier in the same thread, or in another thread before intervening synchronization preceding this thread's exit).
> Perhaps it makes sense to export this helper, do_notify_parent() can > use it too.
It's now quite trivial. Might as well make it a signal.h inline.
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Roland McGrath <roland@redhat.com>
Thanks, Roland
| |