Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327163
b: refs/heads/master
c: 1265057
h: refs/heads/master
i:
  327161: 6664015
  327159: d98a339
v: v3
  • Loading branch information
Tejun Heo committed Aug 13, 2012
1 parent a55f5a8 commit 72b20b5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 41f63c5359d14ca995172b8f6eaffd93f60fec54
refs/heads/master: 1265057fa02c7bed3b6d9ddc8a2048065a370364
1 change: 1 addition & 0 deletions trunk/include/linux/workqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ struct work_struct {
struct delayed_work {
struct work_struct work;
struct timer_list timer;
int cpu;
};

static inline struct delayed_work *to_delayed_work(struct work_struct *work)
Expand Down
7 changes: 4 additions & 3 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ void delayed_work_timer_fn(unsigned long __data)
struct cpu_workqueue_struct *cwq = get_work_cwq(&dwork->work);

local_irq_disable();
__queue_work(WORK_CPU_UNBOUND, cwq->wq, &dwork->work);
__queue_work(dwork->cpu, cwq->wq, &dwork->work);
local_irq_enable();
}
EXPORT_SYMBOL_GPL(delayed_work_timer_fn);
Expand Down Expand Up @@ -1356,6 +1356,7 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq,

set_work_cwq(work, get_cwq(lcpu, wq), 0);

dwork->cpu = cpu;
timer->expires = jiffies + delay;

if (unlikely(cpu != WORK_CPU_UNBOUND))
Expand Down Expand Up @@ -2997,7 +2998,7 @@ bool flush_delayed_work(struct delayed_work *dwork)
{
local_irq_disable();
if (del_timer_sync(&dwork->timer))
__queue_work(WORK_CPU_UNBOUND,
__queue_work(dwork->cpu,
get_work_cwq(&dwork->work)->wq, &dwork->work);
local_irq_enable();
return flush_work(&dwork->work);
Expand All @@ -3020,7 +3021,7 @@ bool flush_delayed_work_sync(struct delayed_work *dwork)
{
local_irq_disable();
if (del_timer_sync(&dwork->timer))
__queue_work(WORK_CPU_UNBOUND,
__queue_work(dwork->cpu,
get_work_cwq(&dwork->work)->wq, &dwork->work);
local_irq_enable();
return flush_work_sync(&dwork->work);
Expand Down

0 comments on commit 72b20b5

Please sign in to comment.