[gccsdk] Threading + Alt-Break = Trashed Computer

Ben Avison bavison at riscosopen.org
Wed Jul 9 15:56:07 PDT 2008

On Wed, 09 Jul 2008 23:10:43 +0100, John Tytgat <John.Tytgat at aaug.net> wrote:
> You don't have to call Wimp_CloseDown.  This is not documented in the
> SWI Wimp_CloseDown section (PRM 3-175) but rather in the
> Service_WimpCoseDown section (PRM 3-75).

Technically speaking, the parent environment's exit handler (implemented in
the Wimp) calls Wimp_CloseDown for you, so it's a side effect of calling
OS_Exit from your own exit handler. It also makes a final call into Wimp_Poll
(which in most cases will never return).

Exit handlers are called in USR mode, of course, so there may be issues
regarding the order of removal of handlers. I'm not familiar with the
mechanisms used in pthreads context switching, but presumably it installs
its own exit handler to remove its non-transient callback handler, and it
might have issues with an exit handler inside that one (ie the DeskLib one)
calling Wimp_CloseDown before the pthreads callback handler has been


More information about the gcc mailing list