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!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Task safe containers? Help needed. Date: Tue, 10 Oct 2017 14:48:35 -0500 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Tue, 10 Oct 2017 19:48:35 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="28381"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: news.eternal-september.org comp.lang.ada:48419 Date: 2017-10-10T14:48:35-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:orhslu$pji$1@gioia.aioe.org... > On 09/10/2017 23:54, Randy Brukardt wrote: > >> If some of the operations are functions, and you have an up-to-date >> compiler, then use aspect Exclusive_Functions so that the mutual >> exclusion >> extends to the functions as well as the procedures in the protected >> object. > > Interesting. > > BTW, if protected types were declared as a normal types without ugly > C++-ish brackets, then we could simply have it passed in-out mode. > Functions are now allowed to have this. Or it could be passed as a > non-constant anonymous access. Both would naturally imply > "update-exclusion", no aspect ever needed. I agree that the function/procedure definition was a bad idea: only 2 of the 4 possibilities are supported, and all of the can make sense. Too late to fix, though. Also note that you might need exclusion for read-only access (that's definitely true in Ada 2005/2012 where there are no guarantee of task safety even for reading of a container -- Ada 2020 will change this slightly). Randy.