Author: MarcoMarco
Date: Jul 6, 2008 11:46
I've got a doubt about wait_event_timeout:
DEFINE_WAIT()
for(;;){
prepare_to_wait();
if(condition)
break;
ret=schedule_timeout();
if(!ret)
break;
}
finish_wait();
if after prepare_to_wait but before the if statement the scheduler
gets up and running (for example after an interrupt), is the caller
process, at this point with state TASK_INTERRUPTIBLE or
TASK_UNINTERRUPTIBLE, blocked untill someone calls wake_up? If so,
wait_event_timeout is equal than wait_event. In addition, if the
wake_up is called before prepare_to_wait and happends this case and
the process was TASK_UNINTERRUPTIBLE, the process will spleep for
ever. Am I saying a stupid thing?
|