Re: mdelay question

Alan Cox (alan@lxorguk.ukuu.org.uk)
Fri, 26 Mar 1999 14:36:10 +0000 (GMT)


> > unsigned long time=jiffies+(msec*HZ)/1000;
> > while(time_before(time, jiffies))
> > schedule();
> >
> > or in an irq/bh set a timer to go off
>
> Don't we now have schedule_timeout() to do this?

You've always been able to do that- this is a bad example of what I meant
sorry.

Instead think of

while(time_before(time, jiffies))
{
if(inb(driver->port+STATUS)&0x01)
break;
schedule();
}

which is the case I meant - where you need to wait for a driver to do
something slow, polled and can't just delay.

Alan

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