diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-10-17 11:29:01 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-10-17 11:29:01 -0400 |
| commit | 50ad5f591bf0d2c877cb3689be01bea9eefdeb2b (patch) | |
| tree | b9979a6649f053fc824f75e4ad65ac22854fd4b4 /kernel/workqueue.c | |
| parent | daaeb6c93829806221b2ac533330c64f338ebb89 (diff) | |
| parent | f6919eb41127db2e06342efcc2da1eeb4646ec34 (diff) | |
Merge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6
Diffstat (limited to 'kernel/workqueue.c')
| -rw-r--r-- | kernel/workqueue.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index addfe2df93b1..47cdd7e76f2b 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
| @@ -640,6 +640,24 @@ int schedule_delayed_work(struct delayed_work *dwork, | |||
| 640 | EXPORT_SYMBOL(schedule_delayed_work); | 640 | EXPORT_SYMBOL(schedule_delayed_work); |
| 641 | 641 | ||
| 642 | /** | 642 | /** |
| 643 | * flush_delayed_work - block until a dwork_struct's callback has terminated | ||
| 644 | * @dwork: the delayed work which is to be flushed | ||
| 645 | * | ||
| 646 | * Any timeout is cancelled, and any pending work is run immediately. | ||
| 647 | */ | ||
| 648 | void flush_delayed_work(struct delayed_work *dwork) | ||
| 649 | { | ||
| 650 | if (del_timer_sync(&dwork->timer)) { | ||
| 651 | struct cpu_workqueue_struct *cwq; | ||
| 652 | cwq = wq_per_cpu(keventd_wq, get_cpu()); | ||
| 653 | __queue_work(cwq, &dwork->work); | ||
| 654 | put_cpu(); | ||
| 655 | } | ||
| 656 | flush_work(&dwork->work); | ||
| 657 | } | ||
| 658 | EXPORT_SYMBOL(flush_delayed_work); | ||
| 659 | |||
| 660 | /** | ||
| 643 | * schedule_delayed_work_on - queue work in global workqueue on CPU after delay | 661 | * schedule_delayed_work_on - queue work in global workqueue on CPU after delay |
| 644 | * @cpu: cpu to use | 662 | * @cpu: cpu to use |
| 645 | * @dwork: job to be done | 663 | * @dwork: job to be done |
