projects/linux·commit 2800d8d1

document de_thread() with exit_notify() connection

2800d8d1 · Oleg Nesterov <[email protected]> · 2008-04-30 00:53:12 -07:00

Add a couple of small comments, it is not easy to see what this code does.

Signed-off-by: Oleg Nesterov <[email protected]>
Cc: Roland McGrath <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
2800d8d19e51414403df8144eaa214bb03400b87
Parents
376e1d25

Changes

2 files changed · +2 −1

FileStatusAddDelContent
fs/exec.cmodified+1−1View file
kernel/exit.cmodified+1−0View file

fs/exec.c

View file
diff --git a/fs/exec.c b/fs/exec.c
index 8fccc27..9f9f931 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -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))

kernel/exit.c

View file
diff --git a/kernel/exit.c b/kernel/exit.c
index 413c81e..879ed6e 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -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)