diff options
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r-- | include/linux/workqueue.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 13e1adf55c4c..7ef0c7b94f31 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 | */ |
@@ -240,6 +240,21 @@ static inline int cancel_delayed_work(struct delayed_work *work) | |||
240 | return ret; | 240 | return ret; |
241 | } | 241 | } |
242 | 242 | ||
243 | /* | ||
244 | * Like above, but uses del_timer() instead of del_timer_sync(). This means, | ||
245 | * if it returns 0 the timer function may be running and the queueing is in | ||
246 | * progress. | ||
247 | */ | ||
248 | static inline int __cancel_delayed_work(struct delayed_work *work) | ||
249 | { | ||
250 | int ret; | ||
251 | |||
252 | ret = del_timer(&work->timer); | ||
253 | if (ret) | ||
254 | work_clear_pending(&work->work); | ||
255 | return ret; | ||
256 | } | ||
257 | |||
243 | extern int cancel_delayed_work_sync(struct delayed_work *work); | 258 | extern int cancel_delayed_work_sync(struct delayed_work *work); |
244 | 259 | ||
245 | /* Obsolete. use cancel_delayed_work_sync() */ | 260 | /* Obsolete. use cancel_delayed_work_sync() */ |