comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A.Kazakov <mailbox@dmitry-kazakov.de>
Subject: Aborting requeued entry calls
Date: Sat, 3 Aug 2002 00:34:20 +0200
Date: 2002-08-03T00:34:20+02:00	[thread overview]
Message-ID: <aidms0$13rsfh$1@ID-77047.news.dfncis.de> (raw)

Hi!

I have a problem and a question. Consider the following:

package Test_Abort is
   protected Thing is
      entry Foo_1;
      entry Foo_2;
   end Thing;
end Test_Abort;
------------------------
with Ada.Text_IO;  use Ada.Text_IO;

package body Test_Abort is
   protected body Thing is
      entry Foo_1 when True is
      begin
         Put_Line ("Foo_1 requeues to Foo_2");
         requeue Foo_2; -- w/o abort
      end Foo_1;
      entry Foo_2 when False is
      begin
         null;
      end Foo_2;
   end Thing;
end Test_Abort;
-------------------------
with Test_Abort;   use Test_Abort;
with Ada.Text_IO;  use Ada.Text_IO;

procedure Test is
begin
   select
      delay 1.0;
   then abort
      Thing.Foo_1;
   end select;
   Put_Line ("Why is that abortable?");
end Test;
--------------------------

The problem. From what I read about requeue with no abort I would expect 
that Test should hang forever. Yet GNAT under Windows successfully
aborts Thing.Foo_1 (after it was requeued to Foo_2).

Is that OK?

If yes, then the question, if a requeued entry call may be silently removed 
from the wait queue, how Thing could become aware of that? Let Foo_1 
changes the state of Thing and Foo_2 restores it, then if Foo_2 get 
silently aborted Thing becomes corrupted. Any solution?

Thanks.

-- 
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



             reply	other threads:[~2002-08-02 22:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-02 22:34 Dmitry A.Kazakov [this message]
2002-08-02 15:33 ` Aborting requeued entry calls Robert A Duff
2002-08-05 13:29   ` Dmitry A. Kazakov
replies disabled

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