aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/workqueue.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-05-04 10:00:16 -0400
committerTakashi Iwai <tiwai@suse.de>2009-05-04 10:00:16 -0400
commit3a20ac2c52b1317f5a5f0bd9cd3cbe8495ddd026 (patch)
tree9a912f2609cefb9698b5cce09cd240bd6dbd09fb /include/linux/workqueue.h
parent18cc8d8d9b74c446832336d8f6e1afb145f9431b (diff)
parent3e5b50165fd0be080044586f43fcdd460ed27610 (diff)
Merge branch 'fix/pcm-jiffies-check' into fix/asoc
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r--include/linux/workqueue.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index b36291130f22..13e1adf55c4c 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -41,6 +41,11 @@ struct delayed_work {
41 struct timer_list timer; 41 struct timer_list timer;
42}; 42};
43 43
44static inline struct delayed_work *to_delayed_work(struct work_struct *work)
45{
46 return container_of(work, struct delayed_work, work);
47}
48
44struct execute_work { 49struct execute_work {
45 struct work_struct work; 50 struct work_struct work;
46}; 51};
@@ -118,12 +123,24 @@ struct execute_work {
118 init_timer(&(_work)->timer); \ 123 init_timer(&(_work)->timer); \
119 } while (0) 124 } while (0)
120 125
126#define INIT_DELAYED_WORK_ON_STACK(_work, _func) \
127 do { \
128 INIT_WORK(&(_work)->work, (_func)); \
129 init_timer_on_stack(&(_work)->timer); \
130 } while (0)
131
121#define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \ 132#define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \
122 do { \ 133 do { \
123 INIT_WORK(&(_work)->work, (_func)); \ 134 INIT_WORK(&(_work)->work, (_func)); \
124 init_timer_deferrable(&(_work)->timer); \ 135 init_timer_deferrable(&(_work)->timer); \
125 } while (0) 136 } while (0)
126 137
138#define INIT_DELAYED_WORK_ON_STACK(_work, _func) \
139 do { \
140 INIT_WORK(&(_work)->work, (_func)); \
141 init_timer_on_stack(&(_work)->timer); \
142 } while (0)
143
127/** 144/**
128 * work_pending - Find out whether a work item is currently pending 145 * work_pending - Find out whether a work item is currently pending
129 * @work: The work item in question 146 * @work: The work item in question