comp.lang.ada
 help / color / mirror / Atom feed
* Task_Barriers
@ 2019-07-25 16:32 Gilbert Gosseyn
  2019-07-25 16:43 ` Task_Barriers Dmitry A. Kazakov
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Gilbert Gosseyn @ 2019-07-25 16:32 UTC (permalink / raw)


with Ada.Text_IO , Ada.Synchronous_Barriers ;
use  Ada.Text_IO , Ada.Synchronous_Barriers ;

procedure Task_Barriers is
   NT: constant := 2;
   SB: Ada.Synchronous_Barriers.Synchronous_Barrier(NT) ;
   Notified : Boolean:= False ;
   task T1 ;
   task T2 ;

   X: Integer :=0;
   Y: Integer :=1;

   task body T1 is
   begin
      loop
         delay 1.0 ;
         Wait_For_Release (SB,Notified) ;
         X:=X+1;
      end loop ;
   end T1 ;

   task body T2 is
   begin
      loop
         delay 1.0 ;
         Wait_For_Release (SB, Notified) ;
         Y:=Y+1;
      end loop ;
   end T2 ;
begin
   null ;
end Task_Barriers ;

This program runs forever, although it should stop when reaching an internal count number?


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

end of thread, other threads:[~2019-07-27  0:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-25 16:32 Task_Barriers Gilbert Gosseyn
2019-07-25 16:43 ` Task_Barriers Dmitry A. Kazakov
2019-07-25 18:56 ` Task_Barriers Dennis Lee Bieber
2019-07-25 20:11   ` Task_Barriers Jeffrey R. Carter
2019-07-25 20:17 ` Task_Barriers Simon Wright
2019-07-25 21:59   ` Task_Barriers Randy Brukardt
2019-07-26  7:52     ` Task_Barriers Simon Wright
2019-07-26 23:59       ` Task_Barriers Dennis Lee Bieber
2019-07-26 10:38   ` Task_Barriers Gilbert Gosseyn
2019-07-26 11:09     ` Task_Barriers Dmitry A. Kazakov
2019-07-26 15:03     ` Task_Barriers Simon Wright
2019-07-27  0:10     ` Task_Barriers Dennis Lee Bieber

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