This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Calling cyg_alarm_delete() from Alarm handler function broken?


OOPS!  Invert all references to CYGIMP_KERNEL_COUNTERS_SORT_LIST.  

The problem occurs when NOT using CYGIMP_KERNEL_COUNTERS_SORT_LIST, and it
is fixed when using it.

Ugh, Mondays...

Thanks,
Jason

-----Original Message-----
From: Jason Gaiser [mailto:JasonG@mail.systech.com]
Sent: Monday, June 16, 2003 11:00 AM
To: 'ecos-discuss@sources.redhat.com'
Subject: [ECOS] Calling cyg_alarm_delete() from Alarm handler function
broken?


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

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]