RosettaCodeData/Task/Program-termination/Ada/program-termination-3.ada

15 lines
335 B
Ada
Raw Normal View History

2023-07-01 11:58:00 -04:00
task body Some_Task is
begin
loop
select
-- Some alternatives
...
or accept Stop do
-- Some cleanup while holding the caller is here
end Stop;
-- A cleanup asynchronous to the caller is here
exit; -- We are through
end select
end loop;
end Some_Task;