Skip to content

Commit

Permalink
document de_thread() with exit_notify() connection
Browse files Browse the repository at this point in the history
Add a couple of small comments, it is not easy to see what this code does.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Oleg Nesterov authored and torvalds committed Apr 30, 2008
1 parent 376e1d2 commit 2800d8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ static int de_thread(struct task_struct *tsk)
if (!thread_group_leader(tsk)) {
leader = tsk->group_leader;

sig->notify_count = -1;
sig->notify_count = -1; /* for exit_notify() */
for (;;) {
write_lock_irq(&tasklist_lock);
if (likely(leader->exit_state))
Expand Down
1 change: 1 addition & 0 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
state = EXIT_DEAD;
tsk->exit_state = state;

/* mt-exec, de_thread() is waiting for us */
if (thread_group_leader(tsk) &&
tsk->signal->notify_count < 0 &&
tsk->signal->group_exit_task)
Expand Down

0 comments on commit 2800d8d

Please sign in to comment.