comp.lang.ada
 help / color / mirror / Atom feed
* requeue with abort and timed call
@ 2008-12-28 13:24 ishikawa
  2008-12-28 14:30 ` Dmitry A. Kazakov
  2008-12-28 15:53 ` sjw
  0 siblings, 2 replies; 39+ messages in thread
From: ishikawa @ 2008-12-28 13:24 UTC (permalink / raw)


Hi,

I found a strange behavior of GNAT about requeue-with-abort.

In the RM,  I found the following definition
>16  * if the original entry call was timed (or conditional), then the original expiration time is the expiration time for the requeued call.
(http://www.adaic.org/standards/1zrm/html/RM-9-5-4.html)

But In the following code,  its timed entry call had never be aborted.
When "Original_Call" does not have "delay 3.0", it got aborted.

It seems that "Original_Call" takes more than 1.0 second(over the
expiration time of the timed call), "with abort" does not work as
intended.
I think the requeued call should be aborted in this case.

Does anyone understand whether this behavior is a bug or not?
I could not find any definition supporting this behavior on RM.

------
with Ada.Text_IO; use Ada.Text_IO;
procedure Req is
   task T is
      entry Original_Call;
      entry Requeued_Call;
   end T;

   task body T is
   begin
      loop
      accept Original_Call do
         Put_Line ("Original Call...");
         -- takes three seconds
         delay 3.0;
         Put_Line ("Original Call Done");
         requeue Requeued_Call with abort;
      end Original_Call;

      -- inifinity loop
      loop
         delay 10.0;
      end loop;

      -- will be never accepted
      accept Requeued_Call do
         Put_Line ("Requeued_Call");
      end Requeued_Call;
      end loop;
   end T;

begin
   select
      T.Original_Call;
   or
      -- just wait 1 second
      delay 1.0;
      Put_Line ("Aborting");
   end select;
   Put_Line ("Parent Done");
end Req;



^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2009-01-06  2:35 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-28 13:24 requeue with abort and timed call ishikawa
2008-12-28 14:30 ` Dmitry A. Kazakov
2008-12-28 15:53   ` christoph.grein
2008-12-28 16:09     ` christoph.grein
2008-12-28 17:46       ` ishikawa
2008-12-29 10:23         ` christoph.grein
2008-12-29 10:55           ` Dmitry A. Kazakov
2008-12-29 11:17             ` christoph.grein
2008-12-29 12:27               ` Dmitry A. Kazakov
2008-12-28 17:16     ` Dmitry A. Kazakov
2008-12-28 21:42       ` Robert A Duff
2008-12-29 10:42       ` Jean-Pierre Rosen
2008-12-29 21:05         ` sjw
2008-12-30  9:25           ` Jean-Pierre Rosen
2008-12-30 13:18             ` christoph.grein
2008-12-30 15:39               ` Jean-Pierre Rosen
2008-12-30 17:01                 ` christoph.grein
2008-12-30 17:16                   ` ishikawa
2008-12-30 15:54               ` ishikawa
2008-12-30 21:33             ` sjw
2008-12-30 22:52               ` Robert A Duff
2008-12-31  9:21               ` Jean-Pierre Rosen
2008-12-31 15:39                 ` christoph.grein
2008-12-31 16:14                   ` Jean-Pierre Rosen
2009-01-03 16:49                     ` ishikawa
2009-01-03 21:09                       ` Jeffrey R. Carter
2009-01-04 15:40                         ` christoph.grein
2009-01-04 17:09                           ` Jeffrey R. Carter
2009-01-04 18:03                         ` ishikawa
2009-01-04 18:56                           ` Dmitry A. Kazakov
2009-01-04 23:17                             ` belteshazzar
2009-01-05  9:12                               ` Dmitry A. Kazakov
2009-01-05  2:48                             ` Jeffrey R. Carter
2009-01-05  9:30                               ` Dmitry A. Kazakov
2009-01-05 20:28                                 ` Jeffrey R. Carter
2009-01-05 20:47                                   ` Dmitry A. Kazakov
2009-01-06  2:35                                     ` Jeffrey R. Carter
2009-01-05 10:17                           ` Jean-Pierre Rosen
2008-12-28 15:53 ` sjw

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