Since Ada 83, section 9.7.1 has contained the following lines:
- A selective_accept shall contain at least one accept_alternative. In addition, it can contain:
-
- a terminate_alternative (only one); or
-
- one or more delay_alternatives; or
-
- an else part (the reserved word else followed by a sequence_of_statements).
- These three possibilities are mutually exclusive.
The rationale does not present a reason for the final condition, unless I have missed it, and I can not think of any obvious reason for this restriction so I would like to propose that those lines are changed to something similar to the following:
- A selective_accept
shall contain at least one may contain multiple accept_alternative. In addition, it can contain:
-
- a terminate_alternative (only one); or
-
- one or more delay_alternatives; or
-
- an else part (the reserved word else followed by a sequence_of_statements).
- These three possibilities are not mutually exclusive.
The rationale for this change is to allow tasks to define termination points without the need for an accept alternative designed solely to terminate the task. This is especially useful for long-running tasks that perform work in a loop, for example:
task body Server is
begin
loop
select
delay 1.0;
Update_Temperature_Reading;
or
terminate;
end select;
end loop;
end Server;
Since Ada 83, section 9.7.1 has contained the following lines:
The rationale does not present a reason for the final condition, unless I have missed it, and I can not think of any obvious reason for this restriction so I would like to propose that those lines are changed to something similar to the following:
The rationale for this change is to allow tasks to define termination points without the need for an accept alternative designed solely to terminate the task. This is especially useful for long-running tasks that perform work in a loop, for example: