Hi Oleg,
As you stated in an earlier mail, the following code should handle all cases.
I think delay==0 is fine now, we take the costly (but rare) path.
int queue_update_delayed_work(struct workqueue_struct *wq,
struct delayed_work *dwork, unsigned long delay)
{
int ret = 1;
while (queue_delayed_work(wq, dwork, delay)) {
unsigned long when = jiffies + delay;
ret = 0;
if (delay && update_timer_expiry(&dwork->timer, when))
break;
cancel_work_sync(&dwork->work);
}
return ret;
}
I will run some tests and submit again.
Thanks once more for explaining patiently some very complicated portions :)
- KK
Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/
--