From: Simon Marlow Date: Fri, 13 Nov 2009 10:45:18 +0000 (+0000) Subject: The rest of the #1185 patch (forkProcess and -threaded) X-Git-Tag: 2009-11-15~2 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=e5959748501564df4a266cbf4df94cb28327f76d The rest of the #1185 patch (forkProcess and -threaded) Due to darcs confusion, I managed to leave out part of the patch for #1185. This should make 1185(threaded1) go through now. --- diff --git a/rts/Schedule.c b/rts/Schedule.c index 539e006..998d846 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -1683,6 +1683,10 @@ forkProcess(HsStablePtr *entry initTimer(); startTimer(); +#if defined(THREADED_RTS) + cap = ioManagerStartCap(cap); +#endif + cap = rts_evalStableIO(cap, entry, NULL); // run the action rts_checkSchedStatus("forkProcess",cap); diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c index 3b93fcc..98115ba 100644 --- a/rts/posix/Signals.c +++ b/rts/posix/Signals.c @@ -135,6 +135,12 @@ ioManagerDie (void) } } +Capability * +ioManagerStartCap (Capability *cap) +{ + return rts_evalIO(cap,&base_GHCziConc_ensureIOManagerIsRunning_closure,NULL); +} + void ioManagerStart (void) { @@ -142,7 +148,7 @@ ioManagerStart (void) Capability *cap; if (io_manager_pipe < 0) { cap = rts_lock(); - cap = rts_evalIO(cap,&base_GHCziConc_ensureIOManagerIsRunning_closure,NULL); + cap = ioManagerStartCap(cap); rts_unlock(cap); } } diff --git a/rts/posix/Signals.h b/rts/posix/Signals.h index 4d0a5a5..b80f711 100644 --- a/rts/posix/Signals.h +++ b/rts/posix/Signals.h @@ -24,6 +24,8 @@ extern siginfo_t *next_pending_handler; void startSignalHandlers(Capability *cap); #endif +Capability *ioManagerStartCap (Capability *cap); + extern StgInt *signal_handlers; END_RTS_PRIVATE