comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Q:finalization or task terminate first?
Date: 1997/03/05
Date: 1997-03-05T00:00:00+00:00	[thread overview]
Message-ID: <E6K333.r3@world.std.com> (raw)
In-Reply-To: 331CF2F4.6B79@bix.com


In article <331CF2F4.6B79@bix.com>, Tom Moran  <tmoran@bix.com> wrote:
>Given a package body with a declaration of an object descended from
>Ada.finalization.controlled, and also a task with a select-terminate
>alternative, when the main program that with's this package reaches its
>end, which will happen first: the Finalize call or the task termination?

Task termination happens first.  Then finalization.  See 7.6.1(4).
In this case, the "master" is the environment task.

This makes sense: you can't finalize things while tasks are still
meddling with them.

See also 10.2(26) and 9.8(20), and note that finalization is
abort-deferred.  And note that all Finalize procedures are library-level
procedures.  These paragraphs ensure that there's no need to await tasks
twice for the same master (that is, once finalization starts for a given
master, all tasks dependent on that master are dead and no more will be
created).

- Bob




      reply	other threads:[~1997-03-05  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-04  0:00 Q:finalization or task terminate first? Tom Moran
1997-03-05  0:00 ` Robert A Duff [this message]
replies disabled

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