comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: How to terminate all running tasks?
Date: Wed, 10 Jun 2020 16:45:30 +0200
Date: 2020-06-10T16:45:30+02:00	[thread overview]
Message-ID: <rbqrma$frr$1@dont-email.me> (raw)
In-Reply-To: <rbqoct$p0r$1@dont-email.me>

On 6/10/20 3:49 PM, Jeffrey R. Carter wrote:
> On 6/10/20 1:14 PM, Gilbert Gosseyn wrote:
>> package packp6 is
>>    procedure tp6pm(N : Long_Integer);
>> end packp6;
>>
>> with Ada.Text_IO; use Ada.Text_IO;
>> package body packp6 is
>>    procedure tp6pm(N : Long_Integer) is
>>       package LIO is new Integer_IO(Long_Integer);
> 
>          Solution_Found : Boolean := False;
>          pragma Atomic (Solution_Found);
>>
>>       task p6p;
>>
>>       task body p6p is
>>          pp,i : Long_Integer := 0;
>>       begin
>>          loop
>                exit when Solution_Found;
> 
>>             i := i+1;
>>             pp := 6*i+1;
>>             if N mod pp = 0 then
>>                new_line;put("pp= ");LIO.put(pp);
>                   Solution_Found := True;
>>             end if;
>>          end loop;
>>       end p6p;

Sorry, of course the variables previously in P6m have to be declared here:

          pm,i : Long_Integer := 0;

>>    begin
>>       loop
>             exit when Solution_Found;
> 
>>          i := i+1;
>>          pm := 6*i-1;
>>          if N mod pm = 0 then
>>             new_line;put("pm= ");LIO.put(pm);
>                Solution_Found := True;
>>          end if;
>>        end loop;
>>    end tp6pm;
>> end packp6;

-- 
Jeff Carter
"Unix and C are the ultimate computer viruses."
Richard Gabriel
99

      reply	other threads:[~2020-06-10 14:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 11:14 How to terminate all running tasks? Gilbert Gosseyn
2020-06-10 12:12 ` Niklas Holsti
2020-06-10 12:29   ` Niklas Holsti
2020-06-10 16:26     ` Simon Wright
2020-06-11  6:04       ` J-P. Rosen
2020-06-10 13:49 ` Jeffrey R. Carter
2020-06-10 14:45   ` Jeffrey R. Carter [this message]
replies disabled

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