comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: How to tell whether program finalization can be suppressed
Date: Sat, 2 Dec 2017 03:12:11 -0800 (PST)
Date: 2017-12-02T03:12:11-08:00	[thread overview]
Message-ID: <ca4c9516-0781-4d72-97c4-b52004a502bb@googlegroups.com> (raw)
In-Reply-To: <ovslub$ajk$1@franka.jacob-sparre.dk>

Am Freitag, 1. Dezember 2017 23:43:25 UTC+1 schrieb Randy Brukardt:
> When 
> the main program exits, of course the environment task completes and then 
> terminates. It's the completion of the environment task that starts 
> library-level finalization. (Indeed, you can use Ada.Task_Identification to 
> figure out that this is happening -- that is how Claw shuts down its tasks, 
> otherwise they would wait forever for operations that aren't ever going to 
> happen.) The termination of the environment tasks causes the entire program 
> to exit (normally or via exception).

Just to refresh my memory:
The main subprogram is the master of any library tasks. It may be empty (I just confirmed this with a little test) and thus does not exit until all library tasks are terminated or waiting on a terminate alternative.

with Lib;  -- in the elaboration sequence, there are some tasks
procedure Main is
begin
  null;  -- waiting here for tasks to terminate
end Main;


  parent reply	other threads:[~2017-12-02 11:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 21:39 How to tell whether program finalization can be suppressed Simon Wright
2017-12-01 22:43 ` Randy Brukardt
2017-12-02  9:48   ` Simon Wright
2017-12-04 20:18     ` Randy Brukardt
2017-12-04 22:41     ` Simon Wright
2017-12-02 11:12   ` AdaMagica [this message]
2017-12-03 17:16     ` Robert Eachus
2017-12-04 11:58       ` AdaMagica
2017-12-04 14:36         ` Robert Eachus
2017-12-04 17:16           ` AdaMagica
2017-12-04 18:21             ` Jeffrey R. Carter
2017-12-04 20:25             ` Randy Brukardt
2017-12-04 20:22         ` Randy Brukardt
2017-12-02  3:08 ` Robert Eachus
2017-12-27 15:49 ` Simon Wright
replies disabled

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