Ada Reference Manual (Ada 2022) — Legal Information

# 9.7.3 Conditional Entry Calls

1/5
A conditional_entry_call issues an entry call that is then cancelled if it is not selected immediately (or if a requeue-with-abort of the call is not selected immediately). A procedure call may appear rather than an entry call for cases where the procedure can be implemented by an entry.

#### Syntax

2
conditional_entry_call ::=
select
entry_call_alternative
else
sequence_of_statements
end select;

#### Dynamic Semantics

3
The execution of a conditional_entry_call is defined to be equivalent to the execution of a timed_entry_call with a delay_alternative specifying an immediate expiration time and the same sequence_of_statements as given after the reserved word else.
4/5
NOTE A conditional_entry_call can briefly increase the Count attribute of the entry, even if the conditional call is not selected.

#### Examples

5
Example of a conditional entry call:
6/5
procedure Spin(R : in out Resource) is -- see 9.4
begin
loop
select
R.Seize;
return;
else
null; -- busy waiting
end select;
end loop;
end;

Ada 2005 and 2012 Editions sponsored in part by Ada-Europe