sleep for ever ?
Hi ,
Take a look at following code :
DECLARE_WAITQUEUE(wait, current);
add_wait_queue(q, &wait);
while (!condition) {
/* if there is an interrupt here , and the interrupt
is just the one the sleeping process wait
for , is this process sleep for the interrupt
for ever ?*/
set_current_state(TASK_INTERRUPTIBLE);
if (signal_pending(current))
/* handle signal */
schedule();
}set_current_state(TASK_RUNNING);remove_wait_queue(q, &wait);
Suppose the process just want to sleep for an hardware event , but before the set_current_state() call , the event come , is the process sleep for ever ?