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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:ad4:46a9:: with SMTP id br9mr2493386qvb.246.1591787691289; Wed, 10 Jun 2020 04:14:51 -0700 (PDT) X-Received: by 2002:a9d:71d6:: with SMTP id z22mr2188984otj.81.1591787691004; Wed, 10 Jun 2020 04:14:51 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 10 Jun 2020 04:14:50 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=156.67.137.91; posting-account=3Fg1FgoAAACfsmWScNfMD1tGFhR4DU0o NNTP-Posting-Host: 156.67.137.91 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7c14755d-f5f0-4000-bde1-d34423cf43abo@googlegroups.com> Subject: How to terminate all running tasks? From: Gilbert Gosseyn Injection-Date: Wed, 10 Jun 2020 11:14:51 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:59028 Date: 2020-06-10T04:14:50-07:00 List-Id: Hi, -- package spezification package packp6 is procedure tp6pm(N : Long_Integer); end packp6; -- package body with Ada.Text_IO; use Ada.Text_IO; with Ada.Task_Identification; package body packp6 is procedure tp6pm(N : Long_Integer) is use Ada.Task_Identification; package LIO is new Integer_IO(Long_Integer); solution_found : exception; task p6p; task p6m; task body p6p is pp,i : Long_Integer := 0; begin loop i := i+1; pp := 6*i+1; if N mod pp = 0 then new_line;put("pp= ");LIO.put(pp); raise solution_found; end if; end loop; end p6p; task body p6m is pm,i : Long_Integer := 0; begin loop i := i+1; pm := 6*i-1; if N mod pm = 0 then new_line;put("pm= ");LIO.put(pm); raise solution_found; end if; end loop; end p6m; begin null; exception when solution_found => Abort_Task(p6p'Identity); Abort_Task(p6m'Identity); end tp6pm; end packp6; -- test with packp6; use packp6; procedure P6_Test is NN : Long_Integer := 11111111111111111; begin tp6pm(NN); end P6_Test; -- test result: pm= 2071723 pp= 5363222357 When in a task the exception solution_found is raised, then I want all running tasks to be terminated immediately. Apparently this does not happen. How to improve?