Hi
I am a relatively newb in the kenel programming. I am using the
function "schedule_timeout" for sleeping for some time. But in some cases
the function returns after the specified timeout but in some instance it
returns immediately, without decrementing the timeout value passed as the
argument.
I have to use this function only, so please suggest what can be
the possible reasons.
The above said instance occured when i was developing a device
driver, where i am implementing the poll. The function do_poll() uses this
function for sleeping for specified timeout value. In normal device
drivers it runs as it should, but when i poll on my device then the
function returns immediately. I used the same timeout value for both the
polls.
Thanx in advance,
Avinash Vyas,
Student,
IIT Kanpur,
India.
> I am a relatively newb in the kenel programming. I am using the
> function "schedule_timeout" for sleeping for some time. But in some cases
> the function returns after the specified timeout but in some instance it
> returns immediately, without decrementing the timeout value passed as the
> argument.
Make sure you have the task set to be in interruptible or uninterrutible
sleep before you do the schedule_timeout
Hi
Yes the problem was what Sir Alan Cox told, when i called my
device driver poll function after making the TASK_INTERRUPTIBLE, it made
the process state again to RUNNING (In a rpc_call() function).
Thanx
########################################
# Avinash Vyas #
# M.Tech. CSE #
# IIT Kanpur #
# #
# Address: C-302, #
# Hall IV, #
# IIT Kanpur. #
# E-mail: [email protected] #
# [email protected] #
# #
########################################