diff options
| author | Rusty Russell <rusty@rustcorp.com.au> | 2003-06-22 06:40:01 -0700 |
|---|---|---|
| committer | David S. Miller <davem@kernel.bkbits.net> | 2003-06-22 06:40:01 -0700 |
| commit | 56fefe5094b18fba642ed60458f6d73bce24d56b (patch) | |
| tree | 1392f08cfdce7a6453c0144f0f253be21208941e /kernel/workqueue.c | |
| parent | c4d6625df333fe57052a3a71e89908c99489fa3f (diff) | |
[PATCH] Workqueue Exit Neatening
Jeff Garzik points out the initializing the exit completion at
exit time is foolish: we should just initialize it at creation time
live everything else in that structure, and avoid the memory barrier.
Diffstat (limited to 'kernel/workqueue.c')
| -rw-r--r-- | kernel/workqueue.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 24dcca29de3b..efeaaa4f0274 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -275,6 +275,7 @@ static int create_workqueue_thread(struct workqueue_struct *wq, INIT_LIST_HEAD(&cwq->worklist); init_waitqueue_head(&cwq->more_work); init_waitqueue_head(&cwq->work_done); + init_completion(&cwq->exit); init_completion(&startup.done); startup.cwq = cwq; @@ -320,10 +321,7 @@ static void cleanup_workqueue_thread(struct workqueue_struct *wq, int cpu) cwq = wq->cpu_wq + cpu; if (cwq->thread) { - printk("Cleaning up workqueue thread for %i\n", cpu); - /* Initiate an exit and wait for it: */ - init_completion(&cwq->exit); - wmb(); /* Thread must see !cwq->thread after completion init */ + /* Tell thread to exit and wait for it. */ cwq->thread = NULL; wake_up(&cwq->more_work); |
