Rewrite of signal-handling (base patch; see also ghc and unix patches)
authorSimon Marlow <marlowsd@gmail.com>
Thu, 19 Feb 2009 10:22:03 +0000 (10:22 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 19 Feb 2009 10:22:03 +0000 (10:22 +0000)
commit29d970ffba3201eaafed574e6f67e2786a80021f
tree5c2436b2b9803ec030f4dbd79dd6cbd6a4a9b1db
parent249113115bce81cfd103564251a6a507c429af4f
Rewrite of signal-handling (base patch; see also ghc and unix patches)

The API is the same (for now).  The new implementation has the
capability to define signal handlers that have access to the siginfo
of the signal (#592), but this functionality is not exposed in this
patch.

#2451 is the ticket for the new API.

The main purpose of bringing this in now is to fix race conditions in
the old signal handling code (#2858).  Later we can enable the new
API in the HEAD.

Implementation differences:

 - More of the signal-handling is moved into Haskell.  We store the
   table of signal handlers in an MVar, rather than having a table of
   StablePtrs in the RTS.

 - In the threaded RTS, the siginfo of the signal is passed down the
   pipe to the IO manager thread, which manages the business of
   starting up new signal handler threads.  In the non-threaded RTS,
   the siginfo of caught signals is stored in the RTS, and the
   scheduler starts new signal handler threads.
GHC/Conc.lhs
GHC/IOBase.lhs
GHC/TopHandler.lhs
include/HsBase.h