On Wed, Dec 19, 2007 at 02:08:14PM -0300, Werner Almesberger wrote:
> Chia-I Wu wrote:
> > +           msleep(90);
> 
> Hmm, such a long msleep isn't so nice. How about this ?

Mh, I don't really understand this.  it's msleep, not mdelay!

msleep very much schedules the current task away, without any
busy-waiting.

>       schedule_timeout_uninterruptible(msecs_to_jiffies(90)+1);
> 
> This will wait at least 90ms, without keeping the CPU busy.

from kernel/timer.c

void msleep(unsigned int msecs)
{
        unsigned long timeout = msecs_to_jiffies(msecs) + 1;

        while (timeout)
                timeout = schedule_timeout_uninterruptible(timeout);
}

Cheers,
-- 
- Harald Welte <[EMAIL PROTECTED]>                      http://openmoko.org/
============================================================================
Software for the world's first truly open Free Software mobile phone

Reply via email to