Re: [REV2: PATCH 1/2]: workqueue: Implement the kernel API

Previous thread: [GIT PULL] ALSA fixes by Takashi Iwai on Tuesday, September 30, 2008 - 9:01 am. (1 message)

Next thread: none
From: Krishna Kumar
Date: Tuesday, September 30, 2008 - 9:25 am

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/
--

Previous thread: [GIT PULL] ALSA fixes by Takashi Iwai on Tuesday, September 30, 2008 - 9:01 am. (1 message)

Next thread: none