[AD] [UNIX] signals and threads

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


When you send SIGINT to an Allegro program under X, it doesn't always
kill it -- often you have to use kill -9.  This patch is for that.

Firstly (not entirely related, but...), we block auxiliary threads from
receiving signals.  This prevents the signal handler being called from
multiple threads when a signal is caught.

Secondly, if we are "locked" when the signal is caught, that means we
are probably in an X drawing call or somesuch.  In that case, simply
use abort instead of trying to shut down X, because it doesn't work.
Michael's original code did this, but I (i think) didn't translate it
completely when adding the thread stuff.

Finally, in the Linux console port: we can't do a simple
raise(SIGTERM) when we get the three finger salute, because the
keyboard handler is in an auxiliary thread, and they don't receive
signals anymore.  So there's a mini-hack :-)

Please test and commit.

Attachment: signals-and-threads.diff.gz
Description: GNU Zip compressed data



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