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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5b0308c42409e5df,start X-Google-Attributes: gid103376,public From: "R. Tim Coslet" Subject: Protected Objects (Geeenhills & VxWorks) Date: 2000/02/10 Message-ID: <38A30F81.F0CAF1E6@kaisere.com>#1/1 X-Deja-AN: 584227244 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@pacbell.net X-Trace: typhoon-la.pbi.net 950210280 206.170.2.191 (Thu, 10 Feb 2000 11:18:00 PST) Organization: SBC Internet Services MIME-Version: 1.0 NNTP-Posting-Date: Thu, 10 Feb 2000 11:18:00 PST Newsgroups: comp.lang.ada Date: 2000-02-10T00:00:00+00:00 List-Id: We have been having repeated problems where Protected Objects don't seem to be functioning correctly in the environment we are working with (Greenhills V1.8.9 w/ VxWorks). The simplest case I have is the following... protected body Example_Protected_Object is entry Send when Available or I_Am_Tired_Of_Waiting is begin -- Do some things here... -- reset the barrier flags Available := False; I_Am_Tired_Of_Waiting := False; -- reset the waiting flag Waiting_For_It := False; end Send; procedure Signal_Available is begin -- set the barrier flag to indicate data has been received Available := True; 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; end Check_For_Timeout; end Example_Protected_Object; The entry (Send) is called from one task, to hold it until data arrives. The procedure (Available) is called from a task that is triggered by an interrupt. The procedure (Check_For_Timeout) is called from the main program loop, running at a lower priority than the other two tasks. When everything is working normally, Available is called following the interrupt processing and the queued call to Send is released from its barrier. Check_For_Timeout is also periodically called by the main program and as expected nothing happens. When I prevent Available from being called however the system locks up. This is not what I expected. I expected the call to Check_For_Timeout by the main program to release the queued call to Send from its barrier. Am I using the protected object correctly, or is something broken in the Greenhills implementation of protected objects? I strongly suspect Greenhills as I have read the LRM sections repeatedly and they seem to say this should work and we were previously forced to convert all protected object Interrupt Handlers to direct calls to VxWorks services (bypassing the Ada implementation). R. Tim Coslet CosletT@KaiserE.com