aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/workqueue.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r--include/linux/workqueue.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 13e1adf55c4c..cf24c20de9e4 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -94,7 +94,7 @@ struct execute_work {
94/* 94/*
95 * initialize all of a work item in one go 95 * initialize all of a work item in one go
96 * 96 *
97 * NOTE! No point in using "atomic_long_set()": useing a direct 97 * NOTE! No point in using "atomic_long_set()": using a direct
98 * assignment of the work data initializer allows the compiler 98 * assignment of the work data initializer allows the compiler
99 * to generate better code. 99 * to generate better code.
100 */ 100 */
@@ -207,6 +207,7 @@ extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
207 207
208extern void flush_workqueue(struct workqueue_struct *wq); 208extern void flush_workqueue(struct workqueue_struct *wq);
209extern void flush_scheduled_work(void); 209extern void flush_scheduled_work(void);
210extern void flush_delayed_work(struct delayed_work *work);
210 211
211extern int schedule_work(struct work_struct *work); 212extern int schedule_work(struct work_struct *work);
212extern int schedule_work_on(int cpu, struct work_struct *work); 213extern int schedule_work_on(int cpu, struct work_struct *work);
@@ -240,6 +241,21 @@ static inline int cancel_delayed_work(struct delayed_work *work)
240 return ret; 241 return ret;
241} 242}
242 243
244/*
245 * Like above, but uses del_timer() instead of del_timer_sync(). This means,
246 * if it returns 0 the timer function may be running and the queueing is in
247 * progress.
248 */
249static inline int __cancel_delayed_work(struct delayed_work *work)
250{
251 int ret;
252
253 ret = del_timer(&work->timer);
254 if (ret)
255 work_clear_pending(&work->work);
256 return ret;
257}
258
243extern int cancel_delayed_work_sync(struct delayed_work *work); 259extern int cancel_delayed_work_sync(struct delayed_work *work);
244 260
245/* Obsolete. use cancel_delayed_work_sync() */ 261/* Obsolete. use cancel_delayed_work_sync() */