9.7.2 Timed Entry Calls
{
AI95-00345-01}
[A
timed_entry_call
issues an entry call that is cancelled if the call (or a requeue-with-abort
of the call) is not selected before the expiration time is reached.
A procedure call may appear rather than an entry call for cases where
the procedure might be implemented by an entry. ]
Syntax
Legality Rules
Reason: This would
be a confusing way to call a procedure, so we only allow it when it is
possible that the procedure is actually an entry. We could have allowed
formal subprograms here, but we didn't because we'd have to allow all
formal subprograms, and it would increase the difficulty of generic code
sharing.
We say “statically
denotes” because an access-to-subprogram cannot be primitive, and
we don't have anything like access-to-entry. So only names of entries
or procedures are possible.
Static Semantics
Discussion: The
above says “possibly the first parameter”, because Ada allows
entries to be renamed and passed as formal subprograms. In those cases,
the task or protected object is implicit in the name of the routine;
otherwise the object is an explicit parameter to the call.
Dynamic Semantics
This paragraph
was deleted.Ramification: {
AI95-00345-01}
The fact that the syntax calls for an entry_call_statement
means that this fact is used in overload resolution. For example, if
there is a procedure X and an entry X (both with no parameters), then
"select X; ..." is legal, because overload resolution knows
that the entry is the one that was meant.
Examples
Example of a timed
entry call:
select
Controller.Request(Medium)(Some_Item);
or
delay 45.0;
-- controller too busy, try something else
end select;
Wording Changes from Ada 83
{
AI05-0299-1}
This
subclause clause
comes before the one for Conditional Entry Calls, so we can define conditional
entry calls in terms of timed entry calls.
Incompatibilities With Ada 95
{
AI95-00345-01}
{
AI05-0005-1}
A procedure call
can be used as the entry_call_alternative
in a timed or conditional entry call, if
the procedure might actually be an entry. Since the fact that something
is an entry could be used in resolving these calls in Ada 95, it is possible
for timed or conditional entry calls that resolved in Ada 95 to be ambiguous
in Ada 2005. That could happen if both an entry and procedure with the
same name and profile exist, which should be rare.
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe