comp.lang.ada
 help / color / mirror / Atom feed
From: "autstspe" <ati@san.rr.com>
Subject: Need a Sanity Check
Date: 10 May 2005 17:49:15 -0700
Date: 2005-05-10T17:49:15-07:00	[thread overview]
Message-ID: <1115772555.000422.205200@f14g2000cwb.googlegroups.com> (raw)

Hello.  I'm seeing some strange behavior from an Ada95 program.  I've
spoken to several people I work with and we all agree it should not
behave the way it does.  Its a simple program so I was wondering if
someone could take a look at the following an tell me what the output
should be.  It should take just a minute.  Unfortunately, due to
restrictions, I can't say much more. Thanks.

==========================================================================
package T123_Pack is

   task type  Three_Entries_Type is
     entry Start ;
     entry One ;
     entry Two ;
     entry Three ;
   end Three_Entries_Type ;

   Three_Entries : Three_Entries_Type ;

   procedure Start ;

end T123_Pack ;
--------------------------------------
with Text_Io ;
package body T123_Pack is

   task body Three_Entries_Type is

   begin

        accept Start ;

          Text_Io.Put_Line("Start");

        loop

        select

          accept One do

           Text_Io.Put_Line("One");

          end ;

        or

          accept Two do

           Text_Io.Put_Line("Two");

          end ;

        or

          accept Three do

           Text_Io.Put_Line("Three");

          end ;

          loop
             null ;
             delay(0.02);
          end loop ;

        end select ; -- select

       end loop ;

  end Three_Entries_Type ;

  procedure Start is

          begin
               Three_Entries.Start ;
          end ;

end T123_Pack ;

--------------------------------------
-- main procedure
--------------------------------------
with T123_Pack ;

procedure T123 is

begin

   T123_Pack.Three_Entries.Start ;
   T123_Pack.Three_Entries.Three ;
   T123_Pack.Three_Entries.One ;

   loop
         T123_Pack.Three_Entries.Three ;
         T123_Pack.Three_Entries.Two ;
         delay(0.02) ;
   end loop ;

end T123 ;




             reply	other threads:[~2005-05-11  0:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-11  0:49 autstspe [this message]
2005-05-11  3:19 ` Need a Sanity Check Jeffrey Carter
2005-05-11 17:08   ` autstspe
2005-05-16 13:43 ` Steve
2005-05-16 15:18   ` Jean-Pierre Rosen
2005-05-20 20:08     ` mark
2005-05-21  4:51       ` Randy Brukardt
replies disabled

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