From afaeb0960325be100be58b929fc5002e4b869289 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Wed, 26 May 2010 14:43:11 -0700 Subject: [PATCH] --- yaml --- r: 198750 b: refs/heads/master c: d344193a05da89c97e965da2c5cbf687d7385eae h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/exec.c | 11 +++++------ trunk/kernel/exit.c | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 6bfbb3d88df9..fa989aa8fa50 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 09faef11df8c559a23e2405d123cb2683733a79a +refs/heads/master: d344193a05da89c97e965da2c5cbf687d7385eae diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 0c72d23ed0e2..e19de6a80339 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -768,7 +768,6 @@ static int de_thread(struct task_struct *tsk) struct signal_struct *sig = tsk->signal; struct sighand_struct *oldsighand = tsk->sighand; spinlock_t *lock = &oldsighand->siglock; - int count; if (thread_group_empty(tsk)) goto no_thread_group; @@ -785,13 +784,13 @@ static int de_thread(struct task_struct *tsk) spin_unlock_irq(lock); return -EAGAIN; } + sig->group_exit_task = tsk; - zap_other_threads(tsk); + sig->notify_count = zap_other_threads(tsk); + if (!thread_group_leader(tsk)) + sig->notify_count--; - /* Account for the thread group leader hanging around: */ - count = thread_group_leader(tsk) ? 1 : 2; - sig->notify_count = count; - while (atomic_read(&sig->count) > count) { + while (sig->notify_count) { __set_current_state(TASK_UNINTERRUPTIBLE); spin_unlock_irq(lock); schedule(); diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index 59a104c673f7..9220967f4256 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -97,7 +97,7 @@ static void __exit_signal(struct task_struct *tsk) * If there is any task waiting for the group exit * then notify it: */ - if (sig->group_exit_task && atomic_read(&sig->count) == sig->notify_count) + if (sig->notify_count > 0 && !--sig->notify_count) wake_up_process(sig->group_exit_task); if (tsk == sig->curr_target)