Partial fix for #926
authorSimon Marlow <simonmar@microsoft.com>
Thu, 1 Feb 2007 11:40:47 +0000 (11:40 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Thu, 1 Feb 2007 11:40:47 +0000 (11:40 +0000)
commite4fdc426413d178c86d3ba93702aad5eb17734bf
tree8f80665cec5201ae2ff67cb36041d3a82a391a2d
parent80ce44f764633347ea15b570e3f758b6e7aecd63
Partial fix for #926
It seems that when a program exits with open DLLs on Windows, the
system attempts to shut down the DLLs, but it also terminates (some
of?) the running threads.  The RTS isn't prepared for threads to die
unexpectedly, so it sits around waiting for its workers to finish.
This bites in two places: ShutdownIOManager() in the the unthreaded
RTS, and shutdownCapability() in the threaded RTS.  So far I've
modified the latter to notice when worker threads have died
unexpectedly and continue shutting down.  It seems a bit trickier to
fix the unthreaded RTS, so for now the workaround for #926 is to use
the threaded RTS.
includes/OSThreads.h
rts/Capability.c
rts/posix/OSThreads.c
rts/win32/OSThreads.c