comp.lang.ada
 help / color / mirror / Atom feed
* task synchronization and returns in accept
@ 2005-02-08 15:36 Evangelista Sami
  2005-02-08 15:56 ` Martin Krischik
  0 siblings, 1 reply; 2+ messages in thread
From: Evangelista Sami @ 2005-02-08 15:36 UTC (permalink / raw)


Hello all

Let's take this piece of code:
-----------------------------------------
procedure Test is
   task type T1;
   task body T1 is
   begin
      null;
   end;
   task type T2 is
      entry E;
   end T2;
   task body T2 is
   begin
      accept E do
         declare
            T : T1;
         begin
            return;
         end;
      end E;
   end;
   My_T2 : T2;
begin
   My_T2.E;
end;
-----------------------------------------

what does exactly happen at the "return" statement in the accept.
does it wait for the termination of task T?

Thanks for any help

Sami



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: task synchronization and returns in accept
  2005-02-08 15:36 task synchronization and returns in accept Evangelista Sami
@ 2005-02-08 15:56 ` Martin Krischik
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Krischik @ 2005-02-08 15:56 UTC (permalink / raw)


Evangelista Sami wrote:

> Hello all
> 
> Let's take this piece of code:
> -----------------------------------------
> procedure Test is
>    task type T1;
>    task body T1 is
>    begin
>       null;
>    end;
>    task type T2 is
>       entry E;
>    end T2;
>    task body T2 is
>    begin
>       accept E do
>          declare
>             T : T1;
>          begin
>             return;
>          end;
>       end E;
>    end;
>    My_T2 : T2;
> begin
>    My_T2.E;
> end;
> -----------------------------------------
> 
> what does exactly happen at the "return" statement in the accept.
> does it wait for the termination of task T?

Yes, T2 need to wait for the end of T1 - just as Test need to wait for the
end of T2.

Martin

-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-08 15:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-08 15:36 task synchronization and returns in accept Evangelista Sami
2005-02-08 15:56 ` Martin Krischik

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