一个简单的任务
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
task My_Task;
task body My_Task is
begin
Put_Line ("Hello from My_Task");
end;
begin
Put_Line ("Hello from Main");
end;
结果
Put_Line
的顺序可以变化。
Hello from My_Task
Hello from Main