* [Q] Task Types
@ 1998-06-09 0:00 John McCabe
1998-06-09 0:00 ` Tucker Taft
1998-06-09 0:00 ` Matthew Heaney
0 siblings, 2 replies; 4+ messages in thread
From: John McCabe @ 1998-06-09 0:00 UTC (permalink / raw)
Is there a means of providing an incomplete declaration of a Task type?
TIA
--
Best Regards
John McCabe
=====================================================================
Not necessarily my company or service providers opinions.
=====================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Q] Task Types
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
1 sibling, 1 reply; 4+ messages in thread
From: Tucker Taft @ 1998-06-09 0:00 UTC (permalink / raw)
John McCabe (jgm@hayling.cwmbran.gecm.com) wrote:
: Is there a means of providing an incomplete declaration of a Task type?
Yes. An incomplete type declaration can be completed by *any*
kind of type, including a task or protected type.
Hence, the following is legal:
type T;
....
task type T is ...
: TIA
YW
: --
: Best Regards
: John McCabe
: =====================================================================
: Not necessarily my company or service providers opinions.
: =====================================================================
--
-Tucker Taft stt@inmet.com http://www.inmet.com/~stt/
Intermetrics, Inc. Burlington, MA USA
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Q] Task Types
1998-06-09 0:00 ` Tucker Taft
@ 1998-06-09 0:00 ` John McCabe
0 siblings, 0 replies; 4+ messages in thread
From: John McCabe @ 1998-06-09 0:00 UTC (permalink / raw)
stt@houdini.camb.inmet.com (Tucker Taft) wrote:
>John McCabe (jgm@hayling.cwmbran.gecm.com) wrote:
>
>: Is there a means of providing an incomplete declaration of a Task type?
>
>Yes. An incomplete type declaration can be completed by *any*
>kind of type, including a task or protected type.
>
>Hence, the following is legal:
>
> type T;
> ....
>
> task type T is ...
>
Brilliant. I'll try that. The problem I was having was that I was trying
to use the syntax:
task type T;
:
:
task type T is.....
--
Best Regards
John McCabe
=====================================================================
Not necessarily my company or service providers opinions.
=====================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Q] Task Types
1998-06-09 0:00 [Q] Task Types John McCabe
1998-06-09 0:00 ` Tucker Taft
@ 1998-06-09 0:00 ` Matthew Heaney
1 sibling, 0 replies; 4+ messages in thread
From: Matthew Heaney @ 1998-06-09 0:00 UTC (permalink / raw)
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1998-06-09 0:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox