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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8893269a4640c798 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-18 03:54:31 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc02.POSTED!not-for-mail From: "Jeffrey Creem" Newsgroups: comp.lang.ada References: Subject: Re: terminate applications X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: NNTP-Posting-Host: 66.31.5.146 X-Complaints-To: abuse@comcast.net X-Trace: sccrnsc02 1058525669 66.31.5.146 (Fri, 18 Jul 2003 10:54:29 GMT) NNTP-Posting-Date: Fri, 18 Jul 2003 10:54:29 GMT Organization: Comcast Online Date: Fri, 18 Jul 2003 10:54:29 GMT Xref: archiver1.google.com comp.lang.ada:40463 Date: 2003-07-18T10:54:29+00:00 List-Id: This is not something I usually have to worry about because almost everything I do is embedded stuff but when I am doing little non embedded programs and I want to kill the program (especially when making use of embedded packages that have no real facilities for shutting down their tasks) I usuallly just terminate the environment task. The package below provides a procedure that when called from anywhere (either main task or any other task) will terminate the environment task and shut down the program. The real answer is that when writing well behaved multi-tasking programs, one needs to provide nice shutdown facilities for all the tasks....but this terminator approach works for the quick and dirty case. package Arnold is procedure Terminator; end Arnold; with Ada.Task_Identification; pragma Elaborate_All(Ada.Task_Identification); package body Arnold is Environment_Task_Id : Ada.Task_Identification.Task_Id := Ada.Task_Identification.Current_Task; procedure Terminator is begin Ada.Task_Identification.Abort_Task(Environment_Task_Id); end Terminator; end Arnold;