Ok...
> So the right way to unconditionally wait for 5 sec _if_ you are not
> registered in any waitqueue and so if you can't be wakenup from a kernel
> event (that is not a signal) is:
>
> __set_current_state(TASK_UNINTERRUPTIBLE);
> schedule_timeout(5*HZ);
Ok, that makes sense...
> >- Something like 95% of callers of schedule_timeout() ignore the
> > return value. Many seem to expect it to not return early: it is
> > used for timed delays in many drivers. Are these all bugs?
>
> They are not buggy if they are using TASK_UNINTERRUPTIBLE and they can't
> be wakenup by _hand_ from a wake_up_process() somewhere.
>
> They are not buggy if they are using TASK_INTERRUPTIBLE and they are
> expecting to return early in case of a signal and they can't be wakenup by
> some lowlevel kernel code.
Look at net/irda/*.c or isdn/hisax/*.c, for example.
-- Dave
-
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/