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,bff0c2e09500f856 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-05 19:16:57 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!upp1.onvoy!onvoy.com!newsengine.sol.net!wn1feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc53.POSTED!not-for-mail From: "Steve Doiel" Newsgroups: comp.lang.ada References: Subject: Re: How do I end the program? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: NNTP-Posting-Host: 12.225.227.101 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc53 1012965416 12.225.227.101 (Wed, 06 Feb 2002 03:16:56 GMT) NNTP-Posting-Date: Wed, 06 Feb 2002 03:16:56 GMT Organization: AT&T Broadband Date: Wed, 06 Feb 2002 03:16:56 GMT Xref: archiver1.google.com comp.lang.ada:19652 Date: 2002-02-06T03:16:56+00:00 List-Id: Yes, but it isn't pretty. Take a look at the module: Ada.Task_Identification. In the main procedure of your program, before entering glutMainLoop save off the task ID of the environment task. env_task_id := Ada.Task_Identification.Current_Task; When you want to kill the program call: Ada.Task_Identification.Abort_Task( env_task_id ); When you kill the environment task, all subordinate tasks are terminated as well. With GNAT 3.14p, I get the message: Execution terminated by abort of environment task On the console window of my test program. SteveD "David Starner" wrote in message news:a3n4mj$9qe1@news.cis.okstate.edu... > How do I exit the program? It may seem like a silly question, but I'm > trying to exit from a function called from a callback written in C, so I > can't just return or raise an exception. glutMainLoop never returns, so > I can't run off the end of the main function. I used > GNAT.OS_Lib.OS_Exit. Is there a pure Ada alternative? > > -- > David Starner - starner@okstate.edu, dvdeug/jabber.com (Jabber) > Pointless website: http://dvdeug.dhis.org > What we've got is a blue-light special on truth. It's the hottest thing > with the youth. -- Information Society, "Peace and Love, Inc."