diff options
Diffstat (limited to 'include/linux/workqueue.h')
| -rw-r--r-- | include/linux/workqueue.h | 18 |
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 | ||
| 208 | extern void flush_workqueue(struct workqueue_struct *wq); | 208 | extern void flush_workqueue(struct workqueue_struct *wq); |
| 209 | extern void flush_scheduled_work(void); | 209 | extern void flush_scheduled_work(void); |
| 210 | extern void flush_delayed_work(struct delayed_work *work); | ||
| 210 | 211 | ||
| 211 | extern int schedule_work(struct work_struct *work); | 212 | extern int schedule_work(struct work_struct *work); |
| 212 | extern int schedule_work_on(int cpu, struct work_struct *work); | 213 | extern 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 | */ | ||
| 249 | static 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 | |||
| 243 | extern int cancel_delayed_work_sync(struct delayed_work *work); | 259 | extern 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() */ |
