diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-01-19 05:09:46 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2004-01-19 05:09:46 -0800 |
| commit | ef03c46d0491c543a5c178fe5689e8eed9c03493 (patch) | |
| tree | c2156a172469b61e5ae7ccfc905c33434250aac7 /kernel/workqueue.c | |
| parent | c8800d33921af03b30e3e5bbb11e8d70e2a75326 (diff) | |
[PATCH] Remove redundant code in workqueue.c
From: Rusty Russell <rusty@rustcorp.com.au>
It turns out that run_workqueue never has signal_pending(), since setting
the handler to SIG_IGN means "don't make zombies, I'm ignoring them". Fix
the comment, don't allow the signal, and remove the unused waitpid loop.
This also allows simpler conversion of workueues to the kthread mechanism,
which uses signals to indicate it's time to stop.
Diffstat (limited to 'kernel/workqueue.c')
| -rw-r--r-- | kernel/workqueue.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 4b109a7d390b..fed20b9813e5 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -14,13 +14,10 @@ * Theodore Ts'o <tytso@mit.edu> */ -#define __KERNEL_SYSCALLS__ - #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/init.h> -#include <linux/unistd.h> #include <linux/signal.h> #include <linux/completion.h> #include <linux/workqueue.h> @@ -171,7 +168,6 @@ static int worker_thread(void *__startup) struct k_sigaction sa; daemonize("%s/%d", startup->name, cpu); - allow_signal(SIGCHLD); current->flags |= PF_IOTHREAD; cwq->thread = current; @@ -180,7 +176,7 @@ static int worker_thread(void *__startup) complete(&startup->done); - /* Install a handler so SIGCLD is delivered */ + /* SIG_IGN makes children autoreap: see do_notify_parent(). */ sa.sa.sa_handler = SIG_IGN; sa.sa.sa_flags = 0; siginitset(&sa.sa.sa_mask, sigmask(SIGCHLD)); @@ -200,14 +196,6 @@ static int worker_thread(void *__startup) if (!list_empty(&cwq->worklist)) run_workqueue(cwq); - - if (signal_pending(current)) { - while (waitpid(-1, NULL, __WALL|WNOHANG) > 0) - /* SIGCHLD - auto-reaping */ ; - - /* zap all other signals */ - flush_signals(current); - } } remove_wait_queue(&cwq->more_work, &wait); complete(&cwq->exit); |
