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=2.1 required=5.0 tests=BAYES_05,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sunybcs!planck!corsair!westley From: westley@corsair.uucp (Terry J. Westley) Newsgroups: comp.lang.ada Subject: Re: Missing accept statement Summary: Verdix detects deadlock; 9X Project Report includes this issue Message-ID: <1990Mar19.182938.17283@planck.uucp> Date: 19 Mar 90 18:29:38 GMT References: <1990Mar15.203521.28171@planck.uucp> <4623@cbnewsl.ATT.COM> Sender: news@planck.uucp (Usenet News) Reply-To: westley%hercules@planck.UUCP (Terry J. Westley) Organization: Calspan Corporation ATC Buffalo, NY List-Id: In article <4623@cbnewsl.ATT.COM> arny@cbnewsl.ATT.COM (arny.b.engelson,wh,) writes: >I could not find anything in the ARM (or the commentaries) that says a task >MUST have an accept statement for every one of its declared entries, just >that there may be more than one. At a minimum, the ARM should be clarified >on this point. Assuming that this situation is therefore allowed, I would >hope a compiler would at least produce a warning message. I would expect >any call to the entry to hang (unless it's a conditional/timed entry call). >In the above example, since there are no calls to the entry, the compiler may >have chosen not to bother with a warning message. Try adding an entry call >and see if the compiler warns you about the impending deadlock. Yes, I had already tried calling the entry from within the procedure body. TASKING_ERROR occurred, presumably because the task terminated before the rendezvous could occur. The following mod to prevent termination gets no warning from the compiler concerning the missing entry. But, happily, the run-time detects DEADLOCK. procedure Missing_Task_Entry is task A_Task is entry Missing_Entry; entry Stop; end A_Task; task body A_Task is begin -- A_Task loop select accept Stop; or terminate; end select; end loop; end A_Task; begin -- Missing_Task_Entry A_Task.Missing_Entry; end Missing_Task_Entry; Detection is really only this implementation, however. Since posting the first message concerning this, I have received the January, 1990, Supplement 1 of the Ada 9X Project Report. Page 9-110, Revision Request #0216, addresses this issue. Terry J. Westley Arvin/Calspan Advanced Technology Center P.O. Box 400, Buffalo, NY 14225 acsu.buffalo.edu!planck!hercules!westley