Hi loody,<br><br><div class="gmail_quote">On Tue, Dec 13, 2011 at 12:44 AM, loody <span dir="ltr">&lt;<a href="mailto:miloody@gmail.com">miloody@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hi all:<br>
There is a kernel API, &quot;schedule_timeout_interruptible&quot;.<br>
since it has the name interruptible, who and how can we interrupt this task?<br>
suppose A use schedule_timeout_interruptible for 20s period and B<br>
found something and he want to wake up A within this 20s period.<br></blockquote><div><br>You send the task a signal. The API for doing this has a rather unfortunate name, and is called kill from user-space.<br><br>From kernel space, you can use kill_pid_info, or kill_proc_info. kill_pid_info is what&#39;s called to send SIGALARM when an itimer expires.<br>
<br>Although using signals in kernel space is fairly rare, it&#39;s typically a user-space to kernel-space thing, not a kernel-space to kernel-space thing.<br><br>In kernel space, I would generally use something like a timed semaphore (down_timeout).<br>
<br>-- <br></div></div>Dave Hylands<br>Shuswap, BC, Canada<br><a href="http://www.davehylands.com" target="_blank">http://www.davehylands.com</a><br>