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,13c68a067434682 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Task question Date: 1997/10/07 Message-ID: #1/1 X-Deja-AN: 279158771 References: <3439D647.7C43@home.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-10-07T00:00:00+00:00 List-Id: In article <3439D647.7C43@home.com>, Larry Coon wrote: >If I do: > > or > terminate; > >in place of the exit then it knows when the "calling" >task is done and will terminate the task, but this isn't >what I want -- the "other stuff" never gets executed. When a terminate alternative is selected, the task will finalize all its local variables before actually becoming terminated. So you can put the "other stuff" in a Finalize procedure, and have it executed that way. If the "other stuff" needs access to local data inside the task, you can put that data inside the Limited_Controlled object, or you can get at it via an access discriminant. >I've also tried adding another accept as a signal for >when the "calling" task is done: > >task body x is >begin > loop > select > accept my_rendezvous (some_data: some_data_type) do > -- Rendezvous stuff > end my_rendezvous; > or > accept done do > exit; > end done; If you willing to have the extra entry, then do this: accept done; exit; So the exit statement comes *after* the accept statement, not inside it. > end select; > end loop; > -- Now do more stuff. >end x; - Bob