From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Taking 'Access of single task/protected object Date: Thu, 7 Jan 2016 11:16:05 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Thu, 7 Jan 2016 18:13:27 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="caa759af2a9c666aec02942f6fe5abd6"; logging-data="17287"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pDclHv03L9lAsijRgfA2WmXx4LSOdB5M=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 In-Reply-To: Cancel-Lock: sha1:BiU2B+L+OAQfqkp29bPbnjONMhQ= X-Enigmail-Draft-Status: N1110 Xref: news.eternal-september.org comp.lang.ada:29046 Date: 2016-01-07T11:16:05-07:00 List-Id: 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