comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <Mats.Weber@elca-matrix.ch>
Subject: Re: idiom for task termination?
Date: 1997/02/10
Date: 1997-02-10T00:00:00+00:00	[thread overview]
Message-ID: <32FF32D7.67D2@elca-matrix.ch> (raw)
In-Reply-To: mheaney-ya023680000802972114020001@news.ni.net


> package P is
>    procedure Initialize (...);
>    procedure Finalize;
>    ...
> end;

If you modify this abstract state machine to make it an abstract state
type, then you can somewhat alleviate the termination problems:

package P is

   type ADT is limited private;

   procedure Init (X : in out ADT; ...);
   procedure Finalize (X : in out ADT);

   ...

private

   task type ADT is
      entry Init (...);
      entry Stop;
      entry E1;
   end ADT;

end;

The user of P will then delcare an object of type P.ADT, which will make
him the master of the task object, and the terminate alternative in the
body of ADT will be selected when the program terminates.




  parent reply	other threads:[~1997-02-10  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <32FA10EF.32A@bix.com>
1997-02-07  0:00 ` idiom for task termination? Robert A Duff
1997-02-07  0:00   ` Tom Moran
1997-02-07  0:00   ` Mats Weber
1997-02-18  0:00     ` Robert A Duff
1997-02-08  0:00 ` Matthew Heaney
1997-02-09  0:00   ` Tom Moran
1997-02-10  0:00     ` Matthew Heaney
1997-02-10  0:00   ` Mats Weber [this message]
1997-02-10  0:00     ` Matthew Heaney
1997-02-11  0:00       ` Tom Moran
replies disabled

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