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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,36bf044dcba542cc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-29 10:26:32 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!cambridge1-snf1.gtei.net!news.gtei.net!inmet!not-for-mail From: Tucker Taft Newsgroups: comp.lang.ada Subject: Re: Question on using protected objects Date: Sat, 29 Sep 2001 13:29:10 -0400 Organization: AverStar Message-ID: <3BB604E6.684884D9@avercom.net> References: NNTP-Posting-Host: 209-6-249-6.c3-0.lex-ubr1.sbo-lex.ma.cable.rcn.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353" Content-Transfer-Encoding: 7bit X-Trace: inmet2.burl.averstar.com 1001784391 6654 209.6.249.6 (29 Sep 2001 17:26:31 GMT) X-Complaints-To: usenet@inmet2.burl.averstar.com NNTP-Posting-Date: 29 Sep 2001 17:26:31 GMT X-Mailer: Mozilla 4.75C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; U; PPC) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:13514 Date: 2001-09-29T17:26:31+00:00 List-Id: DuckE wrote: > Without getting into the details of what I'm leading up to, is the line > marked in the text > code snippet below a valid thing to do? Yes. Is there a reason you thought it might be illegal? It compiles cleanly in my favorite compiler. I presume you might be wondering whether you can use the entry family index in an entry barrier. The answer is definitely. An entry family is like an array of entries, and each has its own entry queue, and may hence have an entry barrier expression that differs according to the entry family index. Normal entries are not allowed to reference their "normal" parameters in the entry barrier expression because there is only one entry queue, and the entry barrier applies to the queue as a whole, not individual calls on the entry. The parameters of course depend on individual calls. -Tucker Taft stt@avercom.net > > > SUBTYPE aWaitSelect IS INTEGER RANGE 1 .. 3; > TYPE aWaitArray IS ARRAY( aWaitSelect ) OF BOOLEAN; > > PROTECTED TYPE aQueueingType IS > ENTRY GetEntry( waitSelect : aWaitSelect; getResult : out Integer ); > PROCEDURE Release( waitSelect : aWaitSelect ); > PRIVATE > ENTRY WaitForIt( aWaitSelect ); > waitFlag : aWaitArray := ( OTHERS => FALSE ); > counter : Natural := 0; > END aQueueingType; > > PROTECTED BODY aQueueingType IS > PROCEDURE Release( waitSelect : aWaitSelect ) IS > BEGIN > waitFlag( waitSelect ) := TRUE; > END Release; > ENTRY GetEntry( waitSelect : aWaitSelect; > getResult : out Integer ) WHEN GetEntry'COUNT = 0 IS > BEGIN > getResult := counter; > counter := counter + 1; > REQUEUE WaitForIt( waitSelect ); > END GetEntry; > ENTRY WaitForIt ( FOR waitSelect IN aWaitSelect ) > WHEN waitFlag( waitSelect ) IS -- <<<<<<<<<<<< is it OK to use > waitSelect here??? > BEGIN > waitFlag( waitSelect ) := FALSE; > END WaitForIt; > END aQueueingType; > > Thanks in advance, > SteveD