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,3cfaa627fc3366de X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Task origin track from a class Date: Tue, 12 Jul 2011 11:31:45 +0100 Organization: A noiseless patient Spider Message-ID: References: <4o0rnqqqec1s$.19h46xsbjbku2.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="25444"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18yZtKmpAZM9c9XeEhjZVyXF/MNpmeNXCw=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:m9mRTtFWeTrv5bddkYVo04kA0pM= sha1:NUoTfC7JDpygxA5ZjHyfxbTSWrg= Xref: g2news2.google.com comp.lang.ada:21152 Date: 2011-07-12T11:31:45+01:00 List-Id: Simon Wright writes: > "Dmitry A. Kazakov" writes: > >> So the unfortunate rule of the thumb is: never use task components, >> but access to task instead. From Finalize you would call Stop entry or >> an equivalent and then free the task object using >> Unchecked_Deallocation. > > With GNAT, best not to free the task object until 'Terminated is True > (GNAT's I have used would silently fail to actually free the TCB! > resulting in an insidious memory leak). Oops, I forgot to add that I'd aborted the task first (as Dmitry said, it's not always possible to arrange a clean shutdown).