comp.lang.ada
 help / color / mirror / Atom feed
* Re: Ada Tasking & LRM
@ 1993-02-16 18:40 Robert I. Eachus
  0 siblings, 0 replies; only message in thread
From: Robert I. Eachus @ 1993-02-16 18:40 UTC (permalink / raw)


     Section 9.4(1) says "Each task depends on at least one master.
A master is a construct that is either a task, a currently executing
block statement or subprogram, or a library package ( a package
declared within another program unit is not a master)."

     The key is the words "at least one".  If a task is declared
within a unit that is enclosed by (one or more) outer units, the outer
units will be masters (if they are not nested packages) whether or not
the innermost enclosing unit is a master.  So the master of My_Task in
the first example is package One and there is no problem.

     The reason the second example raises PROGRAM_ERROR has nothing to
do with this rule.  The type a_task has not been and cannot be
elaborated before the creation of My_Task.  (The elaboration of A_Type
happens in the body of One the ellaboration of My_Task in the spec.)

      Note that one of the advantages of child packages in Ada 9X will
be that it will be possible to have a package which exports both a
task type and a child package containing an object of that type.
The usual Ada 83 solution for this sort of problem (in particular a
need to export both a private type and an object of that type) is to
use generics.

--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1993-02-16 18:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-02-16 18:40 Ada Tasking & LRM Robert I. Eachus

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