From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,73bdb823e1c1f689 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: idiom for task termination? Date: 1997/02/10 Message-ID: <32FF32D7.67D2@elca-matrix.ch>#1/1 X-Deja-AN: 217887878 references: <32FA10EF.32A@bix.com> content-type: text/plain; charset=us-ascii organization: ELCA Matrix SA mime-version: 1.0 reply-to: Mats.Weber@elca-matrix.ch newsgroups: comp.lang.ada x-mailer: Mozilla 3.01 (Macintosh; I; PPC) Date: 1997-02-10T00:00:00+00:00 List-Id: > 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.