From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: [Q] Task Types
Date: 1998/06/09
Date: 1998-06-09T00:00:00+00:00 [thread overview]
Message-ID: <m33edfge22.fsf@mheaney.ni.net> (raw)
In-Reply-To: 6lj3t7$dpd@gcsin3.geccs.gecm.com
John McCabe <jgm@hayling.cwmbran.gecm.com> writes:
> Is there a means of providing an incomplete declaration of a Task type?
The following code compiles cleanly using gnat v3.09.
procedure Test_Task is
type T;
type TA is access T;
task type T is
entry E (O : TA);
end T;
task body T is
begin
accept E (O : TA);
end T;
begin
null;
end Test_Task;
You'd often use access discriminants for this sort of thing:
type RT;
task type TT (RO : access RT) is
entry E;
end TT;
type RT is
limited record
TO : TT (RT'Access);
I : Integer;
end record;
task body TT is
begin
accept E do <whatever> end E;
... RO.I ...
end TT;
Access discriminants give task type TT access to all the components in
the record.
prev parent reply other threads:[~1998-06-09 0:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-06-09 0:00 [Q] Task Types John McCabe
1998-06-09 0:00 ` Tucker Taft
1998-06-09 0:00 ` John McCabe
1998-06-09 0:00 ` Matthew Heaney [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox