comp.lang.ada
 help / color / mirror / Atom feed
From: nabbasi@earthlink.net.NOSPAM
Subject: Re: In Exception ?
Date: 1998/04/07
Date: 1998-04-07T00:00:00+00:00	[thread overview]
Message-ID: <6gcjru$7im@drn.newsguy.com> (raw)
In-Reply-To: 6g7fpc$l08$1@usenet.rational.com


In article <6g7fpc$l08$1@usenet.rational.com>, "Corey says...
>
>
>>Gerhard Auinger wrote in message <35214b7a.0@news.profinet.at>...
>>My problem: I want to establish a  routine that is called out of normal
>>flow, or out of an exception handler. How can I get the knowledge whether I
>>am 'in' an exception (means in its processing) or not.  Is there a sort of
>>function than can be coded like
>>
>>         if  in_exception_handler  then
>>           ...
>>        else
>>           ...
>>        end if;
>
>Ada95 doesn't provide such a feature, I'm afraid.  So you'll need a more
>complicated
>solution.
>
>If you aren't using more than one task, then a simple global variable
>counter
>which is incremented inside the handler and decremented after the handler
>should suffice.  

this takes care of synch. between tasks. but what about interrupts? 
an interrupt could occur anytime, and it also could establish an 
exception, and could end up in it ,  so this would lead 
to a race condition also on the global variable. 

I have not done this, but I assume one could attach an 
ada procedure to an interrupt, or in VMS language, an AST. 
similar synch. issues will show up between
an interrupt and non-interrupt mode code flow, as between different tasks.

I think Ada should have a function that tells one if they are in an
exception handler or not. I know this is platform specific stuff, but
that is the whole idea of using Ada, to hide platform  specific things 
from the user. I remember that PLIon VMS had such a call in its run-time
library, I could be wrong though.

my 2 cents.

Nasser




  reply	other threads:[~1998-04-07  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <35214b7a.0@news.profinet.at>
1998-04-04  0:00 ` In Exception ? Paul Van Bellinghen
1998-04-07  0:00   ` John Herro
1998-04-05  0:00 ` Corey Ashford
1998-04-07  0:00   ` nabbasi [this message]
1998-04-07  0:00     ` Corey Minyard
     [not found]     ` <Er1n22.24v@world.std.com>
1998-04-07  0:00       ` Robert Dewar
1998-04-09  0:00     ` Mats Weber
1998-04-09  0:00       ` nabbasi
1998-04-09  0:00     ` Mats Weber
1998-04-09  0:00       ` nabbasi
1998-04-10  0:00         ` Larry Kilgallen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox