1

我正在尝试中止 ada 程序中的任务,但在编译期间出现此错误:

expect task name or task interface class-wide object for "abort"

代码如下所示:

task type Sending_Message;
type Send_Message is access Sending_Message;

declare
    send    : Send_Message;
begin
    send := new Sending_Message;
    ...
    abort send;   -- this line throws error
end;

当我再次尝试这样的行时:

abort Sending_Message;

我得到错误:

invalid use of subtype mark in expression or call

知道有什么问题吗?

4

1 回答 1

4

您必须明确取消引用访问类型:

abort send.all;
于 2012-01-23T15:38:41.597 回答