> 1) You need to call set_current_state(...) before every call to > schedule[_timeout] - when schedule() returns, the state has been set > to TASK_RUNNING again, so the task will not go to sleep without first > resetting its state to something other. With plain schedule() this > will result in busy-wait, with schedule_timeout() called as above this > can become an infinite loop (or at least a very long wait, depending > on what else the system has to do).
You are absolutely right. I'll fix it. > > 2) What's the point of TASK_INTERRUPTIBLE if interruptions are not > handled? If you really want an interruptible wait, call > schedule_timeout() only once and bail out with -ERESTARTSYS if you got > signal_pending(). Or just use TASK_UNINTERRUPTIBLE. I have no idea. It was so in the original code. But you are right, the code is wrong. Regards Oliver ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel