selective_accept
| timed_entry_call
| conditional_entry_call
| asynchronous_select
accept Driver_Awake_Signal;
or
delay 30.0*Seconds;
Stop_The_Train;
end select;
select
[guard]
select_alternative
{ or
[guard]
select_alternative }
[ else
sequence_of_statements ]
end select;
accept_alternative
| delay_alternative
| terminate_alternative
accept_statement [sequence_of_statements]
delay_statement [sequence_of_statements]
Current_Work_Item : Work_Item;
begin
loop
select
accept Next_Work_Item(WI : in Work_Item) do
Current_Work_Item := WI;
end;
Process_Work_Item(Current_Work_Item);
or
accept Shut_Down;
exit; -- Premature shut down requested
or
terminate; -- Normal shutdown at end of scope
end select;
end loop;
end Server;
select
entry_call_alternative
or
delay_alternative
end select;
entry_call_statement [sequence_of_statements]
Controller.Request(Medium)(Some_Item);
or
delay 45.0;
-- controller too busy, try something else
end select;
select
entry_call_alternative
else
sequence_of_statements
end select;
begin
loop
select
R.Seize;
return;
else
null; -- busy waiting
end select;
end loop;
end;
select
triggering_alternative
then abort
abortable_part
end select;
select
Terminal.Wait_For_Interrupt;
Put_Line("Interrupted");
then abort
-- This will be abandoned upon terminal interrupt
Put_Line("-> ");
Get_Line(Command, Last);
Process_Command(Command(1..Last));
end select;
end loop;
delay 5.0;
Put_Line("Calculation does not converge");
then abort
-- This calculation should finish in 5.0 seconds;
-- if not, it is assumed to diverge.
Horribly_Complicated_Recursive_Function(X, Y);
end select;