comp.lang.ada
 help / color / mirror / Atom feed
From: "e.coli" <maurizio.ferracini@gmail.com>
Subject: task time-out&abort
Date: 22 Jun 2005 11:08:23 -0700
Date: 2005-06-22T11:08:23-07:00	[thread overview]
Message-ID: <1119463703.048124.135330@o13g2000cwo.googlegroups.com> (raw)

here the code...
------------------------------------
with Ada.Text_Io;
with Ada.Task_Identification;

procedure Semplice2 is --processo genitore

   task Un_Task is--specifica
      entry Uno;
      entry Due;
   end Un_Task;

   task body Un_Task is
   begin
      loop
         select
            accept Uno do
               Ada.Text_Io.Put_Line("foo");
            end Uno;
         or
            accept Due do
               Ada.Text_Io.Put_Line("buffering");
               loop           -- ;)
                  delay(0.0);
               end loop;
               Ada.Text_Io.Put_Line("bar");
            end Due;
         end select;
      end loop;
   end Un_Task;

begin --corpo genitore
   Un_Task.Uno;
   Ada.Text_Io.Put_Line ("wait Horribly long calculation");
   select
      delay 5.0;
      Ada.Text_Io.Put_Line ("Horribly long calculation abandoned");
   then abort
      un_task.due;
   end select;
end Semplice2;
-----------------------------------------

but don't work...
how i can do the five second time out?
thanks




             reply	other threads:[~2005-06-22 18:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-22 18:08 e.coli [this message]
2005-06-22 18:40 ` task time-out&abort Dmitry A. Kazakov
2005-06-23 10:11   ` e.coli
2005-06-23 10:59     ` Dmitry A. Kazakov
2005-06-22 19:44 ` Mark Lorenzen
2005-06-23  1:44 ` Steve
2005-06-23 15:26 ` e.coli
2005-06-23 17:01   ` e.coli
2005-06-24 11:42     ` Marius Amado Alves
2005-06-28 21:31       ` Robert A Duff
2005-06-29  0:32         ` Marius Amado Alves
2005-06-29 20:52   ` Robert A Duff
2005-07-18 16:11     ` Robert I. Eachus
replies disabled

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