if (p->real_parent != p->parent) {
__ptrace_unlink(p);
p->state = TASK_ZOMBIE;
- /* If this is a detached thread, this is where it goes away. */
- if (p->exit_signal == -1) {
- /* release_task takes the lock itself. */
- write_unlock_irq(&tasklist_lock);
- release_task (p);
- }
- else {
+ /*
+ * If this is not a detached task, notify the parent. If it's
+ * still not detached after that, don't release it now.
+ */
+ if (p->exit_signal != -1) {
do_notify_parent(p, p->exit_signal);
- write_unlock_irq(&tasklist_lock);
+ if (p->exit_signal != -1)
+ p = NULL;
}
- p = NULL;
}
- else
- write_unlock_irq(&tasklist_lock);
+ write_unlock_irq(&tasklist_lock);
}
if (p != NULL)
release_task(p);