lkml.org 
[lkml]   [2011]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectGeneral question about TASK_INTERRUPTIBLE and schedule_timeout()
From
Hi,

I have a general question about the following 2 lines of code I see
all over the kernel:
1 set_current_state(TASK_INTERRUPTIBLE) ;
2 schedule_timeout(<some value>);

In the above code, if we encounter an interrupt after executing line
1, we will end up
call schedule() from the architecture specific code for CONFIG_PREEMPT
kernels, after
the interrupt handler has been invokled.

This will cause the current task to sleep interruptibly forever
instead of for a certain timeout interval.

Won't this defeat the purpose of the above code to schedule out or
sleep for a certain finite timeout ?
If yes, then what are the techniques to solve this problem ?


Thanks,
Sifram.


\
 
 \ /
  Last update: 2011-08-31 14:51    [W:0.050 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site