Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327155
b: refs/heads/master
c: 715f130
h: refs/heads/master
i:
  327153: bc10d8c
  327151: 72b80f8
v: v3
  • Loading branch information
Tejun Heo committed Aug 3, 2012
1 parent 9086393 commit d060274
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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: 57469821fd5c61f25f783827d7334063cff67d65
refs/heads/master: 715f1300802e6eaefa85f6cfc70ae99af3d5d497
12 changes: 7 additions & 5 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,9 @@ EXPORT_SYMBOL_GPL(delayed_work_timer_fn);
* @dwork: work to queue
* @delay: number of jiffies to wait before queueing
*
* Returns %false if @work was already on a queue, %true otherwise.
* Returns %false if @work was already on a queue, %true otherwise. If
* @delay is zero and @dwork is idle, it will be scheduled for immediate
* execution.
*/
bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
struct delayed_work *dwork, unsigned long delay)
Expand All @@ -1135,6 +1137,9 @@ bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
bool ret = false;
unsigned long flags;

if (!delay)
return queue_work_on(cpu, wq, &dwork->work);

/* read the comment in __queue_work() */
local_irq_save(flags);

Expand Down Expand Up @@ -1185,14 +1190,11 @@ EXPORT_SYMBOL_GPL(queue_delayed_work_on);
* @dwork: delayable work to queue
* @delay: number of jiffies to wait before queueing
*
* Returns %false if @work was already on a queue, %true otherwise.
* Equivalent to queue_delayed_work_on() but tries to use the local CPU.
*/
bool queue_delayed_work(struct workqueue_struct *wq,
struct delayed_work *dwork, unsigned long delay)
{
if (delay == 0)
return queue_work(wq, &dwork->work);

return queue_delayed_work_on(WORK_CPU_UNBOUND, wq, dwork, delay);
}
EXPORT_SYMBOL_GPL(queue_delayed_work);
Expand Down

0 comments on commit d060274

Please sign in to comment.