From: okellogg <okellogg@freenet.de>
Subject: Re: Ada and (SIGTERM?)
Date: Thu, 6 Aug 2009 13:00:45 -0700 (PDT)
Date: 2009-08-06T13:00:45-07:00 [thread overview]
Message-ID: <e25c61b4-c60b-40aa-8a64-4ed19fabed42@k26g2000vbp.googlegroups.com> (raw)
In-Reply-To: a48ec6ae-c0c8-41fb-bdba-2c63c9411028@r24g2000vbn.googlegroups.com
On Aug 6, 9:30 pm, Tomek Wałkuski <tomek.walku...@gmail.com> wrote:
> Thx for replies, but... what am I doing wrong?
>
> protected type Interrupt_Handler is
> procedure Handler;
> pragma Attach_Handler (Handler, 15); -- is it correct for SIGTERM?
Yes, although using Ada.Interrupts.Names.SIGTERM could be more
readable.
>
> function Quit return Boolean;
> private
> Q : Boolean := False;
> end Interrupt_Handler;
>
> protected body Interrupt_Handler is
> procedure Handler is
> begin
> Q := True;
> end Handler;
>
> function Quit return Boolean is
> begin
> return Q;
> end Quit;
> end Interrupt_Handler;
>
> Then... somewhere Interrupt_Handler is declared and loop looks like:
>
> while not Quit loop
> Do_Something;
> end loop;
>
> And... This does not work. What am I missing?
If you are using GNAT then perhaps you need a
pragma Unreserve_All_Interrupts;
somewhere in a library level spec.
Just shooting from the hip here -
Oliver
next prev parent reply other threads:[~2009-08-06 20:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-05 19:58 Ada and (SIGTERM?) Tomek Walkuski
2009-08-06 1:06 ` Adam Beneschan
2009-08-06 18:13 ` sjw
2009-08-06 18:48 ` Adam Beneschan
2009-08-06 19:30 ` Tomek Wałkuski
2009-08-06 19:57 ` Jeffrey R. Carter
2009-08-06 20:02 ` Tomek Wałkuski
2009-08-06 20:00 ` okellogg [this message]
2009-08-08 13:11 ` Tomek Wałkuski
2009-08-08 15:06 ` Maciej Sobczak
2009-08-08 17:53 ` Tomek Wałkuski
2009-08-16 13:11 ` Tomek Wałkuski
2009-08-16 15:47 ` Maciej Sobczak
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox