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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5b0308c42409e5df X-Google-Attributes: gid103376,public From: "DuckE" Subject: Re: Protected Objects (Geeenhills & VxWorks) Date: 2000/02/10 Message-ID: <38a37a91.0@news.pacifier.com>#1/1 X-Deja-AN: 584385314 References: <38A30F81.F0CAF1E6@kaisere.com> <38A31EF9.ECE0B395@averstar.com> <38A33B11.5019A281@kaisere.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Trace: 10 Feb 2000 18:57:21 PST, 216.65.140.141 X-MSMail-Priority: Normal Reply-To: "DuckE" Newsgroups: comp.lang.ada Date: 2000-02-10T00:00:00+00:00 List-Id: Suggestion: Just for grins try the following minor restructing: protected type Example_Protected_Object is entry Send; procedure Signal_Available; procedure Check_For_Timeout; private Available : Boolean := False; I_Am_Tired_Of_Waiting : Boolean := False; Waiting : Boolean := False; CanSend : Boolean := False; end Example_Protected_Object; protected body Example_Protected_Object is entry Send when CanSend is begin -- Do some things here... -- reset the barrier flags Available := False; I_Am_Tired_Of_Waiting := False; -- reset the waiting flag Waiting := False; CanSend := Available or I_Am_Tired_Of_Waiting; end Send; procedure Signal_Available is begin -- set the barrier flag to indicate data has been received Available := True; CanSend := Available or I_Am_Tired_Of_Waiting; end Signal_Available; procedure Check_For_Timeout is begin -- set the barrier flag to indicate data has not been received I_Am_Tired_Of_Waiting := Waiting; -- set the waiting flag Waiting := True; CanSend := Available or I_Am_Tired_Of_Waiting; end Check_For_Timeout; end Example_Protected_Object; The logic is exactly the same as what you had before, but the blocking condition is a simple boolean. I have found that in practice this makes things go more smoothly (not to mention it makes the logic easier to follow). I hope this helps. SteveD