Contents Index Previous Next
9.5.2 Entries and Accept Statements
1
Entry_declarations,
with the corresponding entry_bodies
or accept_statements, are used to
define potentially queued operations on tasks and protected objects.
Syntax
2
entry_declaration
::=
entry defining_identifier [(
discrete_subtype_definition)]
parameter_profile;
3
accept_statement
::=
accept entry_direct_name [(
entry_index)]
parameter_profile [
do
handled_sequence_of_statements
end [
entry_identifier]];
4
entry_index
::= expression
5
entry_body
::=
entry defining_identifier entry_body_formal_part entry_barrier is
declarative_part
begin
handled_sequence_of_statements
end [
entry_identifier];
6
entry_body_formal_part
::= [(
entry_index_specification)]
parameter_profile
7
entry_barrier
::= when condition
8
entry_index_specification
::= for defining_identifier in discrete_subtype_definition
9
If an entry_identifier
appears at the end of an accept_statement,
it shall repeat the entry_direct_name.
If an entry_identifier appears
at the end of an entry_body, it
shall repeat the defining_identifier.
10
An entry_declaration
is allowed only in a protected or task declaration.
Name Resolution Rules
11
In an
accept_statement,
the expected profile for the
entry_direct_name
is that of the
entry_declaration;
the expected type for an
entry_index
is that of the subtype defined by the
discrete_subtype_definition
of the corresponding
entry_declaration.
12
Within the
handled_sequence_of_statements
of an
accept_statement, if a
selected_component
has a
prefix that denotes the corresponding
entry_declaration, then the entity
denoted by the
prefix is the
accept_statement,
and the
selected_component is interpreted
as an expanded name (see
4.1.3); the
selector_name
of the
selected_component has to
be the
identifier for some formal
parameter of the
accept_statement.
Legality Rules
13
An
entry_declaration
in a task declaration shall not contain a specification for an access
parameter (see
3.10).
14
For an
accept_statement,
the innermost enclosing body shall be a
task_body,
and the
entry_direct_name
shall denote an
entry_declaration
in the corresponding task declaration; the profile of the
accept_statement
shall conform fully to that of the corresponding
entry_declaration.
An
accept_statement
shall have a parenthesized
entry_index
if and only if the corresponding
entry_declaration
has a
discrete_subtype_definition.
15
An accept_statement
shall not be within another accept_statement
that corresponds to the same entry_declaration,
nor within an asynchronous_select
inner to the enclosing task_body.
16
An
entry_declaration
of a protected unit requires a completion, which shall be an
entry_body,
and every
entry_body
shall be the completion of an
entry_declaration
of a protected unit.
The profile of the
entry_body
shall conform fully to that of the corresponding declaration.
17
An
entry_body_formal_part
shall have an
entry_index_specification
if and only if the corresponding
entry_declaration
has a
discrete_subtype_definition.
In this case, the
discrete_subtype_definitions
of the
entry_declaration and the
entry_index_specification shall
fully conform to one another (see
6.3.1).
18
A name that denotes a formal parameter of an
entry_body is not allowed within
the entry_barrier of the entry_body.
Static Semantics
19
The parameter modes defined for parameters in
the
parameter_profile of an
entry_declaration
are the same as for a
subprogram_declaration
and have the same meaning (see
6.2).