comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Taking 'Access of single task/protected object
Date: Thu, 7 Jan 2016 11:16:05 -0700
Date: 2016-01-07T11:16:05-07:00	[thread overview]
Message-ID: <n6m9s5$gs7$1@dont-email.me> (raw)
In-Reply-To: <n6m2vi$jt1$1@dont-email.me>

On 01/07/2016 09:18 AM, G.B. wrote:
> It seems impossible to take the 'Access (or 'Unchecked_Access)
> of a single task object, since it cannot be made aliased.
> And, I guess, as it is not of a named type, so that there
> is no way to express even an anonymous access type.
> 
>   task Single is
>      entry Something;
>   end Single;
> 
>   ...some_context (access_discriminant => Single'Access)...

I don't see how you could declare the discriminant, since it requires an access
definition, which requires a designated subtype.

Suppose you could do this somehow. Then every object of the type with the
discriminant would point to the same task. So there would be no need for the
discriminant, since the operations of the type could simply call the entries of
the task directly.

Presumably the desire is to have multiple single tasks, all with an entry
Something, so that the operations of the type can call different tasks. In this
situation, there would be a finite set of known single tasks, so the type could
hold the task ID of the appropriate task, and operations could select the task
to call based on the ID.

-- 
Jeff Carter
"My brain hurts!"
Monty Python's Flying Circus
21

  parent reply	other threads:[~2016-01-07 18:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 16:18 Taking 'Access of single task/protected object G.B.
2016-01-07 17:30 ` Dmitry A. Kazakov
2016-01-07 18:16 ` Jeffrey R. Carter [this message]
2016-01-07 19:38   ` J-P. Rosen
2016-01-07 23:52   ` Randy Brukardt
2016-01-08  8:52     ` J-P. Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox