lkml.org 
[lkml]   [2004]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: workqueue and pending
I tried the patch and it works fine

-Mikkel

Andrew Morton wrote:

>Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
>
>>
>>
>>>
>>>@@ -75,8 +76,11 @@ 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);
>>>+ clear_bit(0, &work->pending);
>>>+ return ret;
>>> }
>>>
>>>
>>>
>>Looks wrong to me. The time may have fired already and queued the
>>work. Clearing pending is an error in this case since the work is
>>indeed pending for execution....
>>
>>
>
>OK...
>
>--- 25/include/linux/workqueue.h~cancel_delayed_work-fix 2004-05-03 20:14:26.796321416 -0700
>+++ 25-akpm/include/linux/workqueue.h 2004-05-03 20:15:41.010039216 -0700
>@@ -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
>-
>
>_
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
>
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.038 / U:2.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site