[gccsdk] Threading + Alt-Break = Trashed Computer

Adam lists at snowstone.org.uk
Wed Jul 9 14:03:48 PDT 2008

In message <78ce57bc4f.ajw498 at caramel.cp15.org>, Alex Waugh  wrote:

> John Tytgat <John.Tytgat at aaug.net> wrote:
> > In message <a1db49bc4f.admin at snowstone.org.uk>
> >           Adam <lists at snowstone.org.uk> wrote:
> > 
> > > I've just been looking through the GCC documentation again and
> > > can't see any mention of this potentially nasty complication of
> > > trying to use signal handlers with pthreads - perhaps it should be
> > > included?
> > 
> > If someone could formulate an autoritive statement on this topic in a
> > paragraph or too, I'm more than glad to see this included in UnixLib
> > documentation.  I'm not sure if I understand all in & outs myself to do
> > that unfortunately.  Alex, is that something you could do (and see this
> > equally worthwhile doing) ?
> IIRC alt-break just calls the exit handler? If so, then I can't think of
> any reason why it shouldn't work. Perhaps it's just a bug in the exit
> handler.

Ah, OK. The DeskLib wimp-initialise code registers an exit handler which
includes a call to Wimp_CloseDown. In a normal exit case this would be
called after all the threads have been joined with the main thread. With
a signal-induced exit, this wouldn't have happened.

So... are there conditions attached to when Wimp_CloseDown can be
called - like Wimp_Initialise, Wimp_Poll and Wimp_StartTask? Perhaps
context switching has to be disabled?


Adam Richardson          Carpe Diem

More information about the gcc mailing list