summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-05-25 01:13:17 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-05-25 01:13:17 -0700
commit73accc3dda343b96b37a0e2b1fd6367b57a20b64 (patch)
tree83be4e576833276f6adee9f9ea58e7b9f7964283 /kernel
parent9ee208ea99489c357d152f0e5020d19d33497d67 (diff)
[PATCH] add notify_count for de_thread
From: Manfred Spraul <manfred@colorfullife.com> de_thread is called by exec to kill all threads in the thread group except the threads required for exec. The waiting is implemented by waiting for a wakeup from __exit_signal: If the reference count is less or equal to 2, then the waiter is woken up. If exec is called by a non-leader thread, then two threads are required for exec. But if a thread group leader calls exec, then only one thread is required for exec. Thus the hardcoded "2" leads to a superfluous wakeup. The patch fixes that by adding a "notify_count" field to the signal structure.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/signal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 3560d7da7032..d1f02ea4b7b1 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -336,7 +336,7 @@ 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) <= 2) {
+ if (sig->group_exit_task && atomic_read(&sig->count) == sig->notify_count) {
wake_up_process(sig->group_exit_task);
sig->group_exit_task = NULL;
}