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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,25ecb78615e0f778 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-23 02:01:58 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!chcgil2-snh1.gtei.net!news.bbnplanet.com!nycmny1-snf1.gtei.net!news.gtei.net!colt.net!news-lond.gip.net!news.gsl.net!gip.net!newsfeed.icl.net!newsfeed.fjserv.net!nnx.oleane.net!oleane!nnrp.oleane.net!skymaster!nobody From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: protected objects and external call Date: Fri, 23 Jan 2004 09:59:17 +0100 Organization: Adalog Message-ID: <72oqub.mka.ln@skymaster> References: <5f59677c.0401220851.3c2922b0@posting.google.com> NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 1074852119 27753 195.25.228.57 (23 Jan 2004 10:01:59 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 23 Jan 2004 10:01:59 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:4694 Date: 2004-01-23T09:59:17+01:00 List-Id: "Evangelista Sami" a �crit dans le message de news:5f59677c.0401220851.3c2922b0@posting.google.com... > hi all > > in RM-9.5.1 we see there is a difference between external and internal > protected calls. Let's consider the following code > ---------------------------------- > protected type Prot is > procedure P; > end Prot; > My_Prots : array (1..10) of Prot; > > protected body Prot is > > procedure P is > begin > ..... > My_Prots(5).P; > .... > end; > > end Prot; > ---------------------------------- > > Is the call "My_Prots(5).P" always considered as an external call or > is it an internal call if the object on which is executed the > procedure is My_Prots(5) ? > It is an external call (in the general case, you cannot know statically whether it's truly external or not). This means that you'll try to grab the lock of the PO again, and this can lead to dead-lock. This is why it is considered a potentially blocking operation, and as such disallowed in a protected operation. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr