,    8  9.  ,     -
         .

 schedule_timeout ()  .    -
 .    .

signed long schedule timeout(signed long timeout)
(

timer_t timer;

unsigned long expire;

switch (timeout)

{     

case MAX_SCHEDULE_TIMEOUT:

schedule();

goto out;

default:

if (timeout < 0)
(

printk(KERN_ERR "schedule_timeout: wrong timeout "
"value %lx from %p\n", timeout,
_builtin_return_address (0)) ;

current->state = TASK_RUNNING;

goto out;

}
}

expire = timeout + jiffies;

init_timer(Stimer) ;

timer.expires = expire;

timer.data -= (unsigned long) current;

time-r. function = process timeout;

add_timer(&timer) ;

schedule() ;

del timer sync(&timer);

timeout = expire - jiffies;

out:

return timeout < 0 ? 0 : timeout;

}

    timer      -
 timeout     .   
   process_timeout () ,  , -
    .   ,  
 schedule ().   ,      -
 TASK_INTERRUPTIBLE  TASKJJNINTERRUPTIBLE,    -
   ,      .

    ,    process_
timeout () ,    .

                                                   231