comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Finalization of static package variables
Date: Wed, 16 May 2007 14:10:44 -0500
Date: 2007-05-16T14:10:44-05:00	[thread overview]
Message-ID: <f2fkrt$s8j$1@jacob-sparre.dk> (raw)
In-Reply-To: 1179324410.556097.234870@u30g2000hsc.googlegroups.com

"Adam Beneschan" <adam@irvine.com> 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.











  parent reply	other threads:[~2007-05-16 19:10 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-08 21:55 Finalization of static package variables Manuel Collado
2007-05-09  8:13 ` Alex R. Mosteo
2007-05-09  8:20 ` Stephen Leake
2007-05-09 15:15   ` Adam Beneschan
2007-05-09 16:01     ` Markus E Leypold
2007-05-09 22:00     ` Manuel Collado
2007-05-09 23:27       ` Adam Beneschan
2007-05-10  4:52         ` Jeffrey R. Carter
2007-05-16  0:41           ` Randy Brukardt
2007-05-10  8:16         ` Alex R. Mosteo
2007-05-16  0:36         ` Randy Brukardt
2007-05-16 14:06           ` Adam Beneschan
2007-05-16 16:47             ` Jeffrey R. Carter
2007-05-16 19:10             ` Randy Brukardt [this message]
2007-05-22  4:41               ` christoph.grein
2007-05-22  6:25                 ` tmoran
2007-05-22 22:19                   ` Randy Brukardt
2007-05-10 10:57       ` Stephen Leake
2007-05-09 22:19   ` Manuel Collado
2007-05-10  5:38     ` AW: " Grein, Christoph (Fa. ESG)
2007-05-10 10:55     ` Stephen Leake
2007-05-11 18:12       ` Manuel Collado
2007-05-11 18:26         ` Robert A Duff
2007-05-12 19:17           ` Finalization of static package variables - summary Manuel Collado
2007-05-16  0:49             ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox