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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c33f8f65997c21d0 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.213.1 with SMTP id gu1mr10520340qab.7.1348503192348; Mon, 24 Sep 2012 09:13:12 -0700 (PDT) Received: by 10.52.30.133 with SMTP id s5mr1935998vdh.10.1348503192303; Mon, 24 Sep 2012 09:13:12 -0700 (PDT) Path: e10ni13434282qan.0!nntp.google.com!l8no8412993qao.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 24 Sep 2012 09:13:12 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.7.60.118; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 91.7.60.118 References: <1667b8e2qt7ei$.1gg1h3hrp9amz$.dlg@40tude.net> <187uk10m6z8xj.yr1cpbgrdur$.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <697f51fe-6971-477a-bf50-cb1b12c792d9@googlegroups.com> Subject: Re: Problem with task component From: AdaMagica Injection-Date: Mon, 24 Sep 2012 16:13:12 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-09-24T09:13:12-07:00 List-Id: On Monday, September 24, 2012 5:44:32 PM UTC+2, Adam Beneschan wrote: > I've been trying to think of a way to get around the "forget" problem by = using controlled types. My first thought was to define a controlled record= (i.e. derived from Ada.Finalization.Limited_Controlled) that has a task as= a component, and have the Finalize routine for the controlled type call th= e Shutdown entry. That way, since the shutdown protocol would be defined, = in essence, right by the definition of the task type, there's no way a proc= edure that uses the type could "forget" to call Shutdown. No good, though;= 7.6.1(4) says that the Finalize routine on the record object would be call= ed *after* the task terminates. So it would be too late. Why not use abort in this case? (In the general case, abort might not work = immediately or be dangerous, but under these circumstances? I used it e.g. = effectively when a commercial flight simulator program - all tasks inside h= ave infinite loops - had to be stopped.)