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,ee06257af909a235 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Finalization of static package variables Date: Wed, 16 May 2007 14:10:44 -0500 Organization: Jacob's private Usenet server Message-ID: References: <4640f20b$1@news.upm.es> <1178723724.958486.24820@u30g2000hsc.googlegroups.com> <464244d8$1@news.upm.es> <1178753228.648765.89390@e65g2000hsc.googlegroups.com> <1179324410.556097.234870@u30g2000hsc.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1179342525 28947 69.95.181.76 (16 May 2007 19:08:45 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 16 May 2007 19:08:45 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Xref: g2news1.google.com comp.lang.ada:15814 Date: 2007-05-16T14:10:44-05:00 List-Id: "Adam Beneschan" wrote in message news:1179324410.556097.234870@u30g2000hsc.googlegroups.com... ... > So, to go back to a point I briefly mentioned in my previous post: > does Ada need a feature that would allow you to call your own > finalization procedure or something when the environment task is > completing, so that you don't have to do this using trickery? No, because your proposed "fix" is more complex than the trick, which is simply to use Ada.Task_Identification: -- In a library package: with Ada.Task_Identification; use Ada.Task_Identification; Env_Task_Id : constant Task_Id := Current_Task; Now, in any task that you want to take special action if the main subprogram has exited: if Is_Completed (Env_Task_Id) then Originally, when I dreamt this up for Claw, no compilers actually implemented it. Indeed, I asked the question to the ARG, which became AI-206. When that was resolved, ACATS test CXC7004 was added to test it, so it is likely that all current compilers support doing this. (Surely all of the Windows ones do, we sent bug reports to all of them...) So there is no need for something fancier, the capability already exists. Randy.