Ada Reference Manual (Ada 2022)Legal Information
Contents   Index   References   Search   Previous   Next 

E.2.1 Shared Passive Library Units

1
A shared passive library unit is used for managing global data shared between active partitions. The restrictions on shared passive library units prevent the data or tasks of one active partition from being accessible to another active partition through references implicit in objects declared in the shared passive library unit. 
Paragraphs 2 and 3 were moved to Annex J, “Obsolescent Features”. 

Legality Rules

4/5
When the library unit aspect (see 13.1.1) Shared_Passive of a library unit is True, the library unit is a shared passive library unit. The following restrictions apply to such a library unit:
5
it shall be preelaborable (see 10.2.1);
6/3
it shall depend semantically only upon declared pure or shared passive library_items;
7/5
it shall not contain a library-level declaration:
7.1/5
of an access type that designates a class-wide type; 
7.2/5
of a type with a part that is of a task type;
7.3/5
of a type with a part that is of a protected type with entry_declarations; or
7.4/5
that contains a name that denotes a type declared within a declared-pure package, if that type has a part that is of an access type; for the purposes of this rule, the parts considered include those of the full views of any private types or private extensions.
8
Notwithstanding the definition of accessibility given in 3.10.2, the declaration of a library unit P1 is not accessible from within the declarative region of a shared passive library unit P2, unless the shared passive library unit P2 depends semantically on P1. 

Static Semantics

9
A shared passive library unit is preelaborated.

Post-Compilation Rules

10
A shared passive library unit shall be assigned to at most one partition within a given program.
11
Notwithstanding the rule given in 10.2, a compilation unit in a given partition does not need (in the sense of 10.2) the shared passive library units on which it depends semantically to be included in that same partition; they will typically reside in separate passive partitions.

Contents   Index   References   Search   Previous   Next 
Ada-Europe Ada 2005 and 2012 Editions sponsored in part by Ada-Europe