This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: On Interruptions
- From: Jonathan Larmour <jlarmour at redhat dot com>
- To: Cristiano Ligieri Pereira <cpereira at ics dot uci dot edu>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Mon, 21 Jan 2002 18:47:30 +0000
- Subject: Re: [ECOS] On Interruptions
- Organization: Red Hat UK Ltd.
- References: <Pine.SOL.4.20.0201181423330.5517-100000@washoe.ics.uci.edu>
Cristiano Ligieri Pereira wrote:
>
> Hi all,
>
> I have a interruption which increments a counter in a periodic basis. The
> variable is also read by any of the threads to find out the counter value
> at any given time.
>
> It turns out that the counter is being increased but when I read its value
> from any of the threads I get a zero as the current value. The counter is
> defined as a "volatile". Is there any other precaution that I should take
> in order to get the right value?
Declared as volatile in declaration as well as definition? Small code
sample possibly?
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine