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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.140.238.70 with SMTP id j67mr10067065qhc.27.1461858806076; Thu, 28 Apr 2016 08:53:26 -0700 (PDT) X-Received: by 10.157.59.34 with SMTP id z31mr204211otb.16.1461858806003; Thu, 28 Apr 2016 08:53:26 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!88no1186401qga.1!news-out.google.com!uv8ni170igb.0!nntp.google.com!sq19no1993087igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 28 Apr 2016 08:53:25 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=158.110.28.161; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 NNTP-Posting-Host: 158.110.28.161 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <84d1b14e-7d8d-4bf4-820b-1fc93ed76114@googlegroups.com> Subject: Potentially_Blocking aspect From: mockturtle Injection-Date: Thu, 28 Apr 2016 15:53:26 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:30313 Date: 2016-04-28T08:53:25-07:00 List-Id: Hi.all,=20 a curiosity just came to my mind. =20 Inside a protected object it is forbidden to invoke a potentially blocking = operation. Although some cases are easily recognized, it could be that a p= rocedure invokes (via several levels of indirection) a blocking action. As= I understand, you can specify pragma Detect_Blocking, but this works at ru= ntime (since H.5 says "An implementation is required to detect a potentiall= y blocking operation within a protected operation, and to raise Program_Err= or"). I was wondering about a possible Potentially_Blocking aspect. Something li= ke (disclaimer: I am making it while I am writing...) procedure foo(x: integer) with Potentially_Blocking; It would be a compile-time error if a procedure that does something blockin= g (an entry call, a select, ... or a call to another Potentially_Blocking p= rocedure) does not have the Potentially_Blocking aspect. Likewise, it woul= d be an error to have the aspect when the procedure is not potentially bloc= king. This would allow you to detect calls to blocking procedures at compile time= . Of course, in order to avoid back-compatibility problems, you could add a p= ragma like Mandatory_Potentially_Blocking(Flag : Boolean) that allows you t= o turn on and off the necessity declaring potentially blocking procedures. I checked and it seems that no such aspect is currently defined. There is = some special reason for this? Riccardo