schedule_timeout() sematics

Ken Pizzini (ken@halcyon.com)
Wed, 18 Aug 1999 19:26:17 -0700


I just fixed a bug in my sonycd535.c driver where I neglected
to set current->state = TASK_INTERRUPTIBLE before I called
schedule_timeout(). While fixing this I was led to wonder:
wouldn't it make sense for schedule_timeout() to set
TASK_INTERRUPIBLE itself? I'm failing to think of a case where
this would not be desirable (but then again, my imagination
isn't working as well as it should be right now).

FWIW: in a quick pass through the drivers/ tree there were only
a few (the lp and some sound drivers) which did not obviously
set current->state = TASK_INTERRUPTIBLE just before the call to
schedule_timeout().

On a related note, while doing the above search, my eye caught
this questionable code fragment in drivers/char/dz.c (at line
1096 in the 2.2.11 version of the source):
schedule_timeout(jiffies + info->close_delay);
Surely this reference to "jiffies" is bogus?

--Ken Pizzini

-
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/