comp.lang.ada
 help / color / mirror / Atom feed
From: westley@corsair.uucp (Terry J. Westley)
Subject: Re: Missing accept statement
Date: 19 Mar 90 18:29:38 GMT	[thread overview]
Message-ID: <1990Mar19.182938.17283@planck.uucp> (raw)
In-Reply-To: 4623@cbnewsl.ATT.COM

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

  parent reply	other threads:[~1990-03-19 18:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-03-15 20:35 Missing accept statement westley
1990-03-16  3:25 ` Karl A. Nyberg
1990-03-16 14:34 ` arny.b.engelson
1990-03-17  6:01   ` Barry Margolin
1990-03-19 18:29   ` Terry J. Westley [this message]
     [not found] <203521@<1990Mar15>
1990-03-16 16:52 ` stt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox