Ok... then this raises a few questions:
- I'm not clear on the semantics of current->state. In various places
in the kernel, it is set to TASK_INTERRUPTIBLE, then may or may not
be set back to TASK_RUNNING. Is not setting it back to TASK_RUNNING
a bug? What are the consequences? Should it be set inside the loop
as above, or should I set it once, before entering the loop?
- 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?
- Are signals the only reason for early-exit? If so, then if I use
TASK_UNINTERRUPTIBLE, does that guarantee that the return value is
always zero, so the loop is superfluous? Why do virtually all
drivers use TASK_INTERRUPTIBLE, when it seems that UNINTERRUPTIBLE
has the more appropriate semantics?
-- 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/