aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2007-05-09 05:34:11 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-09 15:30:52 -0400
commitdfb4b82e1c631b1a6057e77212996a890aa515b7 (patch)
tree9e2fcd9ff6bd990740b3f0a48fc4194f2e64d89f /kernel/workqueue.c
parentf293ea92007419e4f9c52db0cf57af17f45b9f94 (diff)
workqueue: make cancel_rearming_delayed_workqueue() work on idle dwork
cancel_rearming_delayed_workqueue(dwork) will hang forever if dwork was not scheduled, because in that case cancel_delayed_work()->del_timer_sync() never returns true. I don't know if there are any callers which may have problems, but this is not so convenient, and the fix is very simple. Q: looks like we don't need "struct workqueue_struct *wq" parameter. If the timer was aborted successfully, get_wq_data() == wq. Is it worth to add the new function? Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 74f3f7825229..ce72d45c7fd8 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -569,6 +569,10 @@ EXPORT_SYMBOL(flush_work_keventd);
569void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, 569void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq,
570 struct delayed_work *dwork) 570 struct delayed_work *dwork)
571{ 571{
572 /* Was it ever queued ? */
573 if (!get_wq_data(&dwork->work))
574 return;
575
572 while (!cancel_delayed_work(dwork)) 576 while (!cancel_delayed_work(dwork))
573 flush_workqueue(wq); 577 flush_workqueue(wq);
574} 578}