comp.lang.ada
 help / color / mirror / Atom feed
From: evangeli@cnam.fr
Subject: problem with ada.interrupts
Date: 10 Aug 2005 09:01:29 -0700
Date: 2005-08-10T09:01:29-07:00	[thread overview]
Message-ID: <1123689689.517640.262600@z14g2000cwz.googlegroups.com> (raw)

hello
in my program i want to catch the interruption by the user, e.g.,
ctrl+c.
i looked at the RM and it seems that package ada.interrupts is designed
to do this kind of things.
so i tested this little program (my compiler is gnat 3.15p) :


with
  Ada.Interrupts,
  Ada.Interrupts.Names,
  Ada.Text_Io;

procedure Test is

   protected Interruption_Handler is
      procedure SIGINT_Handler;
   end Interruption_Handler;
   protected body Interruption_Handler is
      procedure SIGINT_Handler is
      begin
         Ada.Text_Io.Put_Line("interruption");
      end;
   end Interruption_Handler;

begin

Ada.Interrupts.Attach_Handler(Interruption_Handler.SIGINT_Handler'Access,
                                 Ada.Interrupts.Names.SIGINT);
   Ada.Text_Io.Put_Line("ok");
   delay 5.0;
end;


this compiles fine, but when i launch it, nothing happens (not even the
put_line("ok")).
it seems that even this little program does not terminate :

with
  Ada.Interrupts;

procedure Test is
begin
   null:
end;

i suspect a problem in the elaboration of package Ada.Interrupts, but i
have no idea of how to deal with it.
any idea?

Thanks for any help

Sami




             reply	other threads:[~2005-08-10 16:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-10 16:01 evangeli [this message]
2005-08-10 18:00 ` problem with ada.interrupts Robert A Duff
2005-08-10 18:19 ` jimmaureenrogers
2005-08-25 12:25 ` Thierry Pirot
replies disabled

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