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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9828c94314b4e79a X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Task question... Date: 1997/10/21 Message-ID: #1/1 X-Deja-AN: 282176189 Distribution: inet References: <344580FA.478A@eelab.su.oz.au> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-10-21T00:00:00+00:00 List-Id: In article <344580FA.478A@eelab.su.oz.au>, Paul Van Gorp wrote: >task type t1 is > entry reply; > ... >end t1; > >task type t2 is > ... >end t2; > >task body t1 is > T: t2; >begin > loop > select > accept reply; > T.do_something; > ... > or > ... > T.do_something_else; > ... > end select; > end loop; >end t1; > >task body t2 is >begin > loop > select > ... > -- what I want here, is to invoke t1.reply > -- from within different instances of T1 > -- if you know what I mean > end select; > end loop; >end t2; You can put t2 inside t1, like this: task type t1 is entry reply; ... end t1; task body t1 is task t2 is -- Not "task type t2 is..." ... end t2; task body t2 is begin loop select reply; -- Or, if you prefer, "T1.reply;" ... end select; end loop; end t2; begin loop select accept reply; T2.do_something; ... or ... T2.do_something_else; ... end select; end loop; end t1; Alternatively, you could use an access discriminant on T2 pointing to T1. - Bob