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 X-Google-Thread: 103376,3e11ef4efc073f6b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: requeue with abort and timed call Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <2a60b044-6a5c-4ce6-93e6-6eeefc8806c3@l33g2000pri.googlegroups.com> <1f6rcb1qwt7vx.1mckzyk9ucohf.dlg@40tude.net> <84c56781-1cb1-4d86-be14-e66fc9fdade6@w1g2000prk.googlegroups.com> <7p8onuvzdz18$.1m1dq8n3b52q5.dlg@40tude.net> <9j9ajg.3a7.ln@hunter.axlog.fr> <2a0a1de3-6736-4478-9378-50b8895fa20d@r15g2000prh.googlegroups.com> <133a14c1-efc1-4a27-bc66-cff24a75ef93@z28g2000prd.googlegroups.com> <4uQ7l.509148$yE1.49118@attbi_s21> Date: Sun, 4 Jan 2009 19:56:36 +0100 Message-ID: NNTP-Posting-Date: 04 Jan 2009 19:56:39 CET NNTP-Posting-Host: 6131c1db.newsspool1.arcor-online.net X-Trace: DXC=d47]NI5TFDc:i=48;n?Z:`ic==]BZ:afn4Fo<]lROoRa^YC2XCjHcbiZ29Q9OdP3FkDNcfSJ;bb[eIRnRBaCd On Sun, 4 Jan 2009 10:03:44 -0800 (PST), ishikawa@arielworks.com wrote: > On Jan 4, 6:09�am, "Jeffrey R. Carter" > wrote: >> Delay statements and calls to Ada.Text_IO.Put_Line are potentially blocking >> operations. It is an error to call potentially blocking operations from a >> protected action. See ARM 9.5.1. > I'm sorry, I overlooked it. No, it is perfectly legal to use Put_Line in protected actions *with* GNAT. GNAT implementation explicitly permits this use. So Jeffrey's comment was irrelevant here. You should report this bug to AdaCore. > How about this one; > > with Ada.Text_IO; use Ada.Text_IO; > procedure Timed_Protected is > Z : boolean := True; Pedantically, you should have added pragma Atomic (Z), because you access it from different tasks. And probably Volatile (Z) to prevent loop optimization. But much simpler would be a primitive busy waiting: entry E1 when True is T : Time := Clock + 5.0; begin for I in Unsigned_64'Range loop exit when Clock >= T; end loop; end E1; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de