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=ham 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!postnews.google.com!v5g2000prm.googlegroups.com!not-for-mail From: ishikawa@arielworks.com Newsgroups: comp.lang.ada Subject: Re: requeue with abort and timed call Date: Sun, 4 Jan 2009 10:03:44 -0800 (PST) Organization: http://groups.google.com Message-ID: 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> NNTP-Posting-Host: 121.2.254.211 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1231092224 14456 127.0.0.1 (4 Jan 2009 18:03:44 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 4 Jan 2009 18:03:44 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v5g2000prm.googlegroups.com; posting-host=121.2.254.211; posting-account=UO0ZfgoAAAAg-AJ8SR3KlCGoe1tEbkJa User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.5) Gecko/2008120121 Firefox/3.0.5,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:3197 Date: 2009-01-04T10:03:44-08:00 List-Id: On Jan 4, 6:09=A0am, "Jeffrey R. Carter" wrote: > Delay statements and calls to Ada.Text_IO.Put_Line are potentially blocki= ng > 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. How about this one; with Ada.Text_IO; use Ada.Text_IO; procedure Timed_Protected is Z : boolean :=3D True; protected P is entry E1; entry E2; end P; protected body P is entry E1 when True is begin -- this entry takes 5 seconds while Z loop -- Z will be changed in 5 sec. by T2 null; end loop; end E1; entry E2 when True is begin null; end E2; end P; task T1 is end T1; task body T1 is begin Put_Line ("E1"); P.E1; end T1; task T2 is end T2; task body T2 is begin -- to complete E1, change the flag delay 5.0; Z :=3D False; Put_Line ("E1 done"); end T2; begin delay 0.2; -- to ensure start after T1 Put_Line ("Parent selecting"); select P.E2; Put_Line ("E2"); else Put_Line ("Parent cancelling"); end select; end Timed_Protected; I got the same result from this code. It seems that the cancellation of entry calls occurs only at the end/ start of protected actions. If the onging protected action takes long time, timed calls wait for the end of the onging protected action ignoring its expiration time.