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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4bd6ca8f7a1eb225 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.16.106 with SMTP id f10mr3065396pbd.8.1322642107658; Wed, 30 Nov 2011 00:35:07 -0800 (PST) Path: lh20ni43016pbb.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!newsfeed.utanet.at!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Class with task destructor Date: Wed, 30 Nov 2011 08:35:01 +0000 Organization: A noiseless patient Spider Message-ID: References: <30604696.94.1322013045135.JavaMail.geo-discussion-forums@yqzz20> <24938373.1788.1322615481874.JavaMail.geo-discussion-forums@yqjo5> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="19073"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Of2gwxzf+WRSKWfBvrnB9zxHnoNpBKdc=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:tJrhgTsu2xCqQ4MOOykEyWH90Q0= sha1:win51LPeEPje/HnO5J5PcZfXTZA= Xref: news1.google.com comp.lang.ada:19253 Content-Type: text/plain; charset=us-ascii Date: 2011-11-30T08:35:01+00:00 List-Id: "Rego, P." writes: >> You ought to wait until the task has terminated before freeing it. > > How could I wait for the task termination? > Could be something like > > procedure Destruct (T : access Test_Class) is > T_Ptr : Test_Class_Ptr := Test_Class_Ptr (T); > begin > T.Primary.Finish; > DelayUntilTaskTermination (T_Ptr.Primary); > Free (T_Ptr); > end Destruct; > > ? But is there some package with something like it? while not T_Ptr.Primary'Terminated loop delay 0.001; end loop;