Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32063
b: refs/heads/master
c: 7a6bc1c
h: refs/heads/master
i:
  32061: 7db585f
  32059: 06e6b81
  32055: 0baab9e
  32047: 640a968
  32031: e3f0659
  31999: ed5d477
v: v3
  • Loading branch information
Venkatesh Pallipadi authored and Dave Jones committed Jun 30, 2006
1 parent 85c039c commit 88bc901
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 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: ccb2fe209dac9ff67f6351e783e610073afaaeaf
refs/heads/master: 7a6bc1cdd506cf81f856f0fef4e56a2ba0c5a26d
2 changes: 2 additions & 0 deletions trunk/include/linux/workqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ extern void destroy_workqueue(struct workqueue_struct *wq);

extern int FASTCALL(queue_work(struct workqueue_struct *wq, struct work_struct *work));
extern int FASTCALL(queue_delayed_work(struct workqueue_struct *wq, struct work_struct *work, unsigned long delay));
extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
struct work_struct *work, unsigned long delay);
extern void FASTCALL(flush_workqueue(struct workqueue_struct *wq));

extern int FASTCALL(schedule_work(struct work_struct *work));
Expand Down
38 changes: 23 additions & 15 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,27 @@ int fastcall queue_delayed_work(struct workqueue_struct *wq,
return ret;
}

int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
struct work_struct *work, unsigned long delay)
{
int ret = 0;
struct timer_list *timer = &work->timer;

if (!test_and_set_bit(0, &work->pending)) {
BUG_ON(timer_pending(timer));
BUG_ON(!list_empty(&work->entry));

/* This stores wq for the moment, for the timer_fn */
work->wq_data = wq;
timer->expires = jiffies + delay;
timer->data = (unsigned long)work;
timer->function = delayed_work_timer_fn;
add_timer_on(timer, cpu);
ret = 1;
}
return ret;
}

static void run_workqueue(struct cpu_workqueue_struct *cwq)
{
unsigned long flags;
Expand Down Expand Up @@ -411,21 +432,7 @@ int fastcall schedule_delayed_work(struct work_struct *work, unsigned long delay
int schedule_delayed_work_on(int cpu,
struct work_struct *work, unsigned long delay)
{
int ret = 0;
struct timer_list *timer = &work->timer;

if (!test_and_set_bit(0, &work->pending)) {
BUG_ON(timer_pending(timer));
BUG_ON(!list_empty(&work->entry));
/* This stores keventd_wq for the moment, for the timer_fn */
work->wq_data = keventd_wq;
timer->expires = jiffies + delay;
timer->data = (unsigned long)work;
timer->function = delayed_work_timer_fn;
add_timer_on(timer, cpu);
ret = 1;
}
return ret;
return queue_delayed_work_on(cpu, keventd_wq, work, delay);
}

/**
Expand Down Expand Up @@ -622,6 +629,7 @@ void init_workqueues(void)
EXPORT_SYMBOL_GPL(__create_workqueue);
EXPORT_SYMBOL_GPL(queue_work);
EXPORT_SYMBOL_GPL(queue_delayed_work);
EXPORT_SYMBOL_GPL(queue_delayed_work_on);
EXPORT_SYMBOL_GPL(flush_workqueue);
EXPORT_SYMBOL_GPL(destroy_workqueue);

Expand Down

0 comments on commit 88bc901

Please sign in to comment.