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, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bdb4d50db1f56285,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-14 01:10:42 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!195.64.68.27!newsgate.cistron.nl!news.worldonline.nl!bnewspeer01.bru.ops.eu.uu.net!bnewspost00.bru.ops.eu.uu.net!emea.uu.net!read.news.de.uu.net!not-for-mail Message-ID: <3C42A089.998D3EA0@meppen.sema.slb.com> Date: Mon, 14 Jan 2002 10:10:33 +0100 From: Vincent Smeets Organization: CCI - SchlumbergerSema X-Mailer: Mozilla 4.77 [en] (X11; U; SunOS 5.6 sun4m) X-Accept-Language: nl, en, de MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: timed entry call doesnt timeout Content-Type: multipart/mixed; boundary="------------C3640B9057691AA7BBADAD93" NNTP-Posting-Host: zerberus.cci.de X-Trace: 1010999434 read.news.de.uu.net 193 193.103.165.100 X-Complaints-To: abuse@de.uu.net Xref: archiver1.google.com comp.lang.ada:18889 Date: 2002-01-14T10:10:33+01:00 List-Id: This is a multi-part message in MIME format. --------------C3640B9057691AA7BBADAD93 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hallo, gnat 3.13p on Solaris 2.6. I have added a little demo file. I am writing a driver for an network protocol which will send data and wait for an acknowledgement. I have implemented it in a package (Pkt) with a procedure interface. Inside this package, I use a protected type and the requeue statement to implement an action with a timeout. If I directly call the interface (Pkt.Proc) it works OK. I get the expected timeout. But if I call the interface from an extra protected type, then the timeout doesn't occure. The call will hang forever. In my case, it isn't a big problem because I am writing the other parts of the program too. But what is the correct way? If I write a package like this and let someone else call the procedures from my package. In that case, I can't be sure that the other programmer isn't using protected types to call my package. Thanks, Vincent -- Vincent Smeets SchlumbergerSema - Competence Center Informatik GmbH Lohberg 10 - 49716 Meppen - Germany tel: +49 5931-805-461 fax: +49 5931-805-175 mail: VSmeets@slb.com web: www.cci.de --------------C3640B9057691AA7BBADAD93 Content-Type: text/plain; charset=us-ascii; name="demo.adb" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="demo.adb" with Ada.Text_IO; procedure Demo is package Pkt is procedure Proc; end Pkt; package body Pkt is protected Prot is entry Proc; private entry Proc_Wait; end Prot; protected body Prot is entry Proc when True is begin Ada.Text_IO.Put_Line ("Pkt.Prot.Proc"); requeue Proc_Wait with abort; end Proc; entry Proc_Wait when False is begin Ada.Text_IO.Put_Line ("Pkt.Prot.Proc_Wait"); end Proc_Wait; end Prot; procedure Proc is begin Ada.Text_IO.Put_Line ("Pkt.Proc: start"); select Prot.Proc; Ada.Text_IO.Put_Line ("Pkt.Proc: Prot.Proc OK"); or delay 1.0; Ada.Text_IO.Put_Line ("Pkt.Proc: Prot.Proc timeout"); end select; end Proc; end Pkt; protected Outside_Prot is procedure Proc; end Outside_Prot; protected body Outside_Prot is procedure Proc is begin Ada.Text_IO.Put_Line ("Outside_Prot.Proc: start"); Pkt.Proc; end Proc; end Outside_Prot; begin Pkt.Proc; Outside_Prot.Proc; end Demo; --------------C3640B9057691AA7BBADAD93--