protected_type_declaration ::=
protected type defining_identifier [known_discriminant_part] is
protected_definition;
single_protected_declaration ::= protected defining_identifier is protected_definition;
protected_definition ::=
{ protected_operation_declaration }
[ private
{ protected_element_declaration } ]
end [protected_identifier]
protected_operation_declaration ::=
subprogram_declaration
| entry_declaration
| representation_clause
protected_element_declaration ::= protected_operation_declaration | component_declaration
protected_body ::=
protected body defining_identifier is
{ protected_operation_item }
end [protected_identifier];
protected_operation_item ::=
subprogram_declaration
| subprogram_body
| entry_body
| representation_clause
NOTES
protected type Resource is entry Seize; procedure Release; private Busy : Boolean := False; end Resource;
protected body Resource is
entry Seize when not Busy is
begin
Busy := True;
end Seize;
procedure Release is
begin
Busy := False;
end Release;
end Resource;
protected Shared_Array is -- Index, Item, and Item_Array are global types function Component (N : in Index) return Item; procedure Set_Component(N : in Index; E : in Item); private Table : Item_Array(Index) := (others => Null_Item); end Shared_Array;
protected body Shared_Array is
function Component(N : in Index) return Item is
begin
return Table(N);
end Component;
procedure Set_Component(N : in Index; E : in Item) is
begin
Table(N) := E;
end Set_Component;
end Shared_Array;
Control : Resource; Flags : array(1 .. 100) of Resource;
Go to the first, previous, next, last section, table of contents.