[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Confusion regarding spin_lock_irqsave and spin_unlock_irqrestore.
Hi,
A very newbie question on locking.
LDD3 talks about spin_lock_irqsave and spin_unlock_restore and
mentions that the two _must_ be called from the same function or the
code might break on some architecture. I searched for this on google
and found that one of the platform on which it can break is sparc.
However in the implementation of timers (kernel/timer.c) in the
function __mod_timer the spin_lock_irqsave and spin_unlock_restore are
being called from different functions. Of course the flag variable
used is same in both cases but this differs from what I have read.
So how does this work ? I am using 2.6.15.7 and 2.6.17.3 kernel.
-
Regards,
Ranjan
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/