Red Hat Bugzilla – Bug 23316
ISR detach/attach race
Last modified: 2007-04-18 12:30:31 EDT
Jesper Skov wrote:
> Shouldn't the void Cyg_Interrupt::attach(void)/detach(void) functions
> disable interrupts? Otherwise they are not thread safe - and I don't
> believe there's any documentation that requires that all interrupt
> handlers must be set up before the scheduler starts [and even if there
> was, there should be an assertion to that effect].
> Also, there's the potential for a race between those functions and an
> interrupt causing a chained list to be iterated.
I would have thought the assumption is that it is up to the *caller* of
Cyg_Interrupt::attach/detach to disable interrupts if that's what's needed.
And in most cases the interrupt would be unmasked after it's attached
(unless there are chained ISRs, but that's for the user to worry about).
Perhaps the solution you really want is documentation?
This bug has moved to http://bugs.ecos.sourceware.org/show_bug.cgi?id>23316