/* If it's our own child, there is no notification to do. But if our normal children self-reap, then this child was prevented by ptrace and we must reap it now, in that case we must also wake up sub-threads sleeping in do_wait().  */
static bool __ptrace_detach(struct task_struct *tracer, struct task_struct *p)
/* If it's our own child, there is no notification to do. But if our normal children self-reap, then this child was prevented by ptrace and we must reap it now, in that case we must also wake up sub-threads sleeping in do_wait().  */
static bool __ptrace_detach(struct task_struct *tracer, struct task_struct *p)
{
	__ptrace_unlink(p);
	if (p->exit_state == EXIT_ZOMBIE) {
		if (!task_detached(p) && thread_group_empty(p)) {
			if (!same_thread_group(p->real_parent, tracer))
				do_notify_parent(p, p->exit_signal);
			else if (ignoring_children(tracer->sighand)) {
				__wake_up_parent(p, tracer);
				p->exit_signal = -1;
			}
		}
		if (task_detached(p)) {
			p->exit_state = EXIT_DEAD;
			return true;
		}
	}
	return false;
}