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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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: "G.B." Newsgroups: comp.lang.ada Subject: Taking 'Access of single task/protected object Date: Thu, 7 Jan 2016 17:18:26 +0100 Organization: A noiseless patient Spider Message-ID: Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 7 Jan 2016 16:15:46 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="20385"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18chqYMhAta/KYPAIYzqNagNogsvi4V1cY=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 X-Mozilla-News-Host: news://news.arcor.de:119 Cancel-Lock: sha1:VugMHEsP3TNFpiw575rrY3CRuNA= Xref: news.eternal-september.org comp.lang.ada:29044 Date: 2016-01-07T17:18:26+01:00 List-Id: 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. This is, I think, the crucial bit of a question (34540199) asked at stackoverflow. (The example uses some listener pattern which looks like Java written in Ada, but that's not why I'm asking.) task Single is entry Something; end Single; ...some_context (access_discriminant => Single'Access)... somefile: prefix of "Access" attribute must be aliased So, suppose some_context requires indirect access to a single task object, i.e., to one of an anonymous task type. Is there a preferred solution to single-task vs. multiple references?