diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2007-07-16 02:41:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 12:05:51 -0400 |
commit | 1f1f642e2f092e37eb9038060eb0100c44f55a11 (patch) | |
tree | 73dea7896dea85dcf5cfa13b9e3ebf9645868160 /include/linux | |
parent | f5a421a4509a7e2dff11da0f01b0548f4f84d503 (diff) |
make cancel_xxx_work_sync() return a boolean
Change cancel_work_sync() and cancel_delayed_work_sync() to return a boolean
indicating whether the work was actually cancelled. A zero return value means
that the work was not pending/queued.
Without that kind of change it is not possible to avoid flush_workqueue()
sometimes, see the next patch as an example.
Also, this patch unifies both functions and kills the (unlikely) busy-wait
loop.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Jarek Poplawski <jarkao2@o2.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/workqueue.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 5c89ac6e7f55..ce6badc98f6d 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -148,7 +148,7 @@ extern int keventd_up(void); | |||
148 | extern void init_workqueues(void); | 148 | extern void init_workqueues(void); |
149 | int execute_in_process_context(work_func_t fn, struct execute_work *); | 149 | int execute_in_process_context(work_func_t fn, struct execute_work *); |
150 | 150 | ||
151 | extern void cancel_work_sync(struct work_struct *work); | 151 | extern int cancel_work_sync(struct work_struct *work); |
152 | 152 | ||
153 | /* | 153 | /* |
154 | * Kill off a pending schedule_delayed_work(). Note that the work callback | 154 | * Kill off a pending schedule_delayed_work(). Note that the work callback |
@@ -166,7 +166,7 @@ static inline int cancel_delayed_work(struct delayed_work *work) | |||
166 | return ret; | 166 | return ret; |
167 | } | 167 | } |
168 | 168 | ||
169 | extern void cancel_delayed_work_sync(struct delayed_work *work); | 169 | extern int cancel_delayed_work_sync(struct delayed_work *work); |
170 | 170 | ||
171 | /* Obsolete. use cancel_delayed_work_sync() */ | 171 | /* Obsolete. use cancel_delayed_work_sync() */ |
172 | static inline | 172 | static inline |