我已經創建了定義的2個任務類型,並在主程序中對它們進行了實例化。Ada 95任務:我如何從一個實例化任務發送集合到另一個實例化任務中的另一個集合?
如何在單獨的任務之間發送集合點?
Procedure Task_Prog is
task type Task_one is
entry Redezvous_One;
end Task_one;
task type Task_Two is
entry Redezvous_Two;
end Task_Two;
task body Task_one is
Finished : Boolean := False;
begin
while not Finished loop
accept Redezvous_One do
finished := True;
Task_Instantiation_B.Redezvous_Two;
end Redezvous_One;
end loop;
end Task_one;
task body Task_Two is
Finished : Boolean := False;
begin
while not Finished loop
accept Redezvous_Two do
finished := True;
end Redezvous_Two;
end loop;
end Task_Two;
Task_Instantiation_A : Task_one;
Task_Instantiation_B: Task_Two;
begin
Task_Instantiation_A.Redezvous_One;
end Task_Prog;
編譯錯誤是:
task_prog.ada: Error: line 17 col 4 LRM:4.1(3), Direct name, Task_Instantiation_B, is not visible, Ignoring future references
我正在尋找一個任務能夠管的命令/會合到已經被實例化的其他任務。
任何幫助將不勝感激。