diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-05-03 17:57:17 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-03 17:57:17 -0700 |
| commit | 99e956271c2e71831882047232a790ce36d804ce (patch) | |
| tree | cad40a47b7b65d15dca99598a3dbde4a5d9b9ce6 /include/linux | |
| parent | db6b3bf0e23de740e58670db1fb11e66275fba2c (diff) | |
[PATCH] cancel_delayed_work() fix
cancel_delayed_work() forgets to clear the workqueue's pending flag. This
makes the workqueue appear to be permanently busy, so any subsequent attempts
to use it will fail.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/workqueue.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index d9ee0fc9e84f..50633a827900 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -7,6 +7,7 @@ #include <linux/timer.h> #include <linux/linkage.h> +#include <linux/bitops.h> struct workqueue_struct; @@ -75,8 +76,12 @@ extern void init_workqueues(void); */ static inline int cancel_delayed_work(struct work_struct *work) { - return del_timer_sync(&work->timer); + int ret; + + ret = del_timer_sync(&work->timer); + if (ret) + clear_bit(0, &work->pending); + return ret; } #endif - |
