From: "Steve Doiel" <nospam_steved94@attbi.com>
Subject: Re: How do I end the program?
Date: Wed, 06 Feb 2002 03:16:56 GMT
Date: 2002-02-06T03:16:56+00:00 [thread overview]
Message-ID: <Ie188.29041$S06.95354@rwcrnsc53> (raw)
In-Reply-To: a3n4mj$9qe1@news.cis.okstate.edu
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" <dvdeug@x8b4e53cd.dhcp.okstate.edu> 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."
next prev parent reply other threads:[~2002-02-06 3:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-04 23:15 How do I end the program? David Starner
2002-02-05 3:52 ` dale
2002-02-05 6:17 ` Simon Wright
2002-02-05 7:39 ` Dmitriy Anisimkov
2002-02-05 12:35 ` David C. Hoos
2002-02-05 13:26 ` Stephen Leake
2002-02-06 3:16 ` Steve Doiel [this message]
2002-02-06 7:46 ` Dale Stanbrough
2002-02-06 8:40 ` Martin Dowie
2002-02-06 17:55 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox