[ECOS] Calling cyg_alarm_delete() from Alarm handler function broken?

Jason Gaiser JasonG@mail.systech.com
Mon Jun 16 18:13:00 GMT 2003


Hello!

There appears to be a bug in the ecos Alarm code when using
CYGIMP_KERNEL_COUNTERS_SORT_LIST.  According to the documentation,
cyg_alarm_delete() is callable from DSR context.  Therefore its implied that
it is safe to call from an alarm handler routine.  However, the
Cyg_Counter::tick() function moves alarm_list to a temporary location when
scanning the list for expired timers.  If the alarm handler, called from
within tick(), tries to delete a timer with cyg_alarm_delete(), the list may
be left in an inconsistent state.  I first noticed this when a timer I
deleted from another timer's handler function came back from the dead and
triggered its handler.  I took a quick peek down in the timer code and
couldn't find the cause of my problem, but I think they may be related.

I apologize for not researching this further and submitting a patch, but the
project schedule is tight and switching to unsorted lists fixes the problem.

-Jason


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list