[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to interrupt waiting for a semaphore after a timeout



On Mon, Sep 29, 2003 at 12:02:40 +0000, Tomaz Beltram wrote:
> I was looking for a more lightweight solution. I need timed semaphore down 
> from within a kernel module. The idea was to substitute down() with 
> down_interruptible() and check for the return value. I would then wake_up 
> the waiting process from another thread after some time. Dynamic timers 
> seem just perfect for this job. Obviously, I am not doing it the right way, 
> as the process remains locked.

down_interruptible means it's interruptible with SIGNAL, so it returns
only if signal_pending().

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/