Re: [AD] GGI patch for 3.9.21

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Jason Wilkins <fenix@xxxxxxxxxx> writes:
> I'd like to interject some thoughts of mine here.  I can't seem to get 
> exit() to work reliably on BeOS if the program has multiple threads. 
> I'm not sure if its supposed to work and I'm doing something wrong. 

I would expect exit() to kill off all the active threads, but that might 
cause problems if the order of processing is important, but it gets it wrong.

Allegro already has a standard mechanism to handle this situation, though: 
use _add_exit_func() to register your cleanup routine, and call 
_remove_exit_func() from inside the handler. This makes sure that your 
cleanup code will always be run even in emergency shutdown situations, and 
takes care to remove things in the opposite order to which they were 
installed.

Or you could just use the system driver exit function for this: that will 
always be called immediately after the other shutdown routines.


--
Shawn Hargreaves - shawn@xxxxxxxxxx - http://www.talula.demon.co.uk/
"A binary is barely software: it's more like hardware on a floppy disk."



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/