On Tue, Dec 13, 2011 at 12:44 AM, loody
<miloody@gmail.com> wrote:
hi all:
There is a kernel API, "schedule_timeout_interruptible".
since it has the name interruptible, who and how can we interrupt this task?
suppose A use schedule_timeout_interruptible for 20s period and B
found something and he want to wake up A within this 20s period.
You send the task a signal. The API for doing this has a rather unfortunate name, and is called kill from user-space.
From kernel space, you can use kill_pid_info, or kill_proc_info. kill_pid_info is what's called to send SIGALARM when an itimer expires.
Although using signals in kernel space is fairly rare, it's typically a user-space to kernel-space thing, not a kernel-space to kernel-space thing.
In kernel space, I would generally use something like a timed semaphore (down_timeout).
--
Dave Hylands