diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2011-11-04 23:15:29 +0900 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2011-11-04 23:15:29 +0900 |
| commit | d63638440cfad75fb339fd1261bea0485c7c3ecc (patch) | |
| tree | d1705ceeef82eb0b7b58f9503a472be810f418f2 /kernel/workqueue.c | |
| parent | f1e0477a7b7a541f51eea279910eed4ddd010033 (diff) | |
| parent | 1a67a573b8d9f02211f36fbab50f6265dc49384a (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into rmobile-latest
Diffstat (limited to 'kernel/workqueue.c')
| -rw-r--r-- | kernel/workqueue.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 25fb1b0e53fa..1783aabc6128 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -2412,8 +2412,13 @@ reflush: for_each_cwq_cpu(cpu, wq) { struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq); + bool drained; - if (!cwq->nr_active && list_empty(&cwq->delayed_works)) + spin_lock_irq(&cwq->gcwq->lock); + drained = !cwq->nr_active && list_empty(&cwq->delayed_works); + spin_unlock_irq(&cwq->gcwq->lock); + + if (drained) continue; if (++flush_cnt == 10 || |
