Re: workqueue and pending

From: Benjamin Herrenschmidt
Date: Mon May 03 2004 - 21:56:00 EST



>
> @@ -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....

Ben.


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