11/22/2007 8:43 AM
post2846
|
On Thu, Nov 22, 2007 at 08:19:37AM -0500, Daniel Rodrick wrote:
> Can I call InterruptLock() recursively? Something like this:
>
> InterruptLock(lock1);
> InterruptLock(lock1);
> /* do something */
> InterruptUnlock(lock1);
> InterruptUnlock(lock1);
Nope, InterruptLock() doesn't count (neither does InterruptDisable()). As
as matter of fact, you'll permanently hang up on the spin lock of the
second InterruptLock.
> And how about this:
> InterruptLock(lock1);
> InterruptLock(lock2);
> /* do something */
> InterruptUnlock(lock2);
> InterruptUnlock(lock1);
You won't hang on this one, but interrupts will be re-enabled after
the first InterruptUnlock().
--
Brian Stecher (bstecher@qnx.com) QNX Software Systems
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8
|
|
|