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,e2e6547249e6f9d1 X-Google-Attributes: gid103376,public From: Stephen & Tammy House Subject: Re: How to wait for task completion Date: 1996/09/20 Message-ID: <32433FD4.202D@ro.com>#1/1 X-Deja-AN: 184297898 references: <01bba2e8$c45aad90$35208b82@wd> <01bba2fb$2aed33e0$3c8371a5@dhoossr.iquest.com> content-type: text/plain; charset=us-ascii organization: RENAISSANCE INTERNET SERVICES mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (Win95; I) Date: 1996-09-20T00:00:00+00:00 List-Id: David C. Hoos, Sr. wrote: > > wiljan wrote in article > <01bba2e8$c45aad90$35208b82@wd>... > > At a certain point I want to clean up the resources that the task is > > using but this can only be done when the task is completed. > > If the task can't clean up its own resources, why not provide a subprogram > it can call just before it terminates? > -- > David C. Hoos, Sr., > http://www.dbhwww.com > http://www.ada95.com Interesting, I just happen to have written this very thing this week. A task type is written such that its last act is to take itself out of a global list of tasks. It also frees the list node which held the pointer to itself and frees itself (as the task is an object) with an instance of Unchecked Deallocation. Any guess as to whether the task terminates normally or disappears in a flurry of segmentation faults as the object is returned to the heap? It doesn't seem to matter much, it goes away and the RTS doesn't complain (or hasn't yet).