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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,36bf044dcba542cc,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-28 20:45:53 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!feed.textport.net!out.nntp.be!propagator-SanJose!news-in-sanjose!newshub2.rdc1.sfba.home.com!news.home.com!news1.sttln1.wa.home.com.POSTED!not-for-mail From: "DuckE" Newsgroups: comp.lang.ada Subject: Question on using protected objects X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Sat, 29 Sep 2001 03:45:53 GMT NNTP-Posting-Host: 24.248.45.203 X-Complaints-To: abuse@home.net X-Trace: news1.sttln1.wa.home.com 1001735153 24.248.45.203 (Fri, 28 Sep 2001 20:45:53 PDT) NNTP-Posting-Date: Fri, 28 Sep 2001 20:45:53 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:13506 Date: 2001-09-29T03:45:53+00:00 List-Id: 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? 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