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=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,667de268f02e30c1 X-Google-Attributes: gid103376,public From: balmacara9@aol.com (Balmacara9) Subject: Re: task pointer Date: 1997/10/25 Message-ID: <19971025042701.AAA00381@ladder01.news.aol.com>#1/1 X-Deja-AN: 284810527 References: <344AA999.1AB2@eelab.su.oz.au> X-Admin: news@aol.com Organization: AOL http://www.aol.com Newsgroups: comp.lang.ada Date: 1997-10-25T00:00:00+00:00 List-Id: There is probably an easier way to do this through the system programming annex. I am much more familiar with Ada83 so this is an Ada83 type of solution. >task type t1; -- incomplete type declaration > >type t1_ptr is access t1; > >task type t1 is > entry start(**acess to type t1**); > entry a; > entry done; >end t1; > >task type t2 is > entry a(** access to type t1 **); > entry b; >end t2; > > >task body t1 is > T: t2; > Self : t1_ptr; >begin > accept start(**acess to type t1**); > Self := **acess to type t1**; > > loop > select > T.a(Self); > T.b; > ... > or > accept done; > ... > end select; > end loop; >end t1; > >task body t2 is > Parent: **task t1 pointer** >begin > loop > select > accept a(**task pointer**) do > Parent := task pointer; > end; > ... > *task pointer*.done; > or > ... >end t2; Starting the task would look like this; Task1 : t1_ptr := new t1; Task1.Start(task1); This is ugly, but it should work. In Ada95 you may be able pass around task ids as opposed to access types.