Fix #1185: restart the IO manager after fork()
authorSimon Marlow <marlowsd@gmail.com>
Tue, 3 Nov 2009 16:05:40 +0000 (16:05 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Tue, 3 Nov 2009 16:05:40 +0000 (16:05 +0000)
commitc32b545138f37d8455fd2dbd6d70eeb5c9e8b085
treeedf3ed4894c01e2b9de00fc5bd1df4096c10c5c6
parentc9a570d40a51e7af771ad66074b445382463aa2f
Fix #1185: restart the IO manager after fork()

This is the libraries/base part of the patch; there is a corresponding
patch to GHC itself.

The main change is that we now keep track of the IO manager's ThreadId
in a top-level MVar, and ensureIOManagerIsRunning checks whether a
previous IO manager thread is alive before starting one.  In the child
of fork(), we can hence call ensureIOManagerIsRunning to restart the
IO manager.
GHC/Conc.lhs