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!paganini.bofh.team!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 16 Sep 2017 20:35:58 -0500 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: how to use "in out" for the "self" parameter in a function in a protected object? Date: Sat, 16 Sep 2017 21:35:58 -0400 Organization: IISS Elusive Unicorn Message-ID: References: User-Agent: ForteAgent/8.00.32.1272 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.73.117.186 X-Trace: sv3-WjnZOlbtjf3jZPtHfpY6dPmvJPYqupzYGnmaPz8861DoxRQW2vEfKN1DRXtm3iIKkyZVDX069sKQ3AX!vmtuoTO1nCeyloUXEBe6PvX3jpNGoIDlpELfjrEuWSYcatWPesCguhE8rUmqKT1U6ksDNdVWc9Mv!tzPP1f+bmC2h+4qJkLocmc5R8kBM X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2420 Xref: news.eternal-september.org comp.lang.ada:48161 Date: 2017-09-16T21:35:58-04:00 List-Id: On Sun, 17 Sep 2017 00:40:12 +0200, Frank Buss declaimed the following: > >What's the rationale for this behavior and where can I find the >definition, that it is not allowed? Doesn't look useful to me, because I >can do this with a procedure. In fact now I have written a procedure As I recall... Functions are considered read-only, and hence don't need the same locking behavior that is required to safely call into procedures. Consolidated Ada Reference Manual -- 2005 Edition (Springer) section 9.5.1 """ A protected subprogram is a subprogram declared immediately within a protected_definition. Protected procedures provide exclusive read-write access to the data of a protected object; protected functions provide concurrent read-only access to the data. """ ... so, multiple tasks can call protected functions without blocking each other, but a call to a protected procedure blocks all other attempts to access the object. I don't know how 2012's change to allow in/out parameters on functions applies to protected objects. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/