From 3501ac6af749ada0afcaf84f112ab2e4bf9120b9 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 3 Nov 2009 16:05:47 +0000 Subject: Fix #1185 (RTS part, also needs corresponding change to libraries/base) GHC.Conc.ensureIOManagerIsRunning now creates an IO manager thread if one does not exist or has died/exited. Unfortunately this exposed a problem caused by the fact that we have two base packages, and hence two IO managers, in GHCi: see NOTE [io-manager-ghci] in rts/Linker.c. The workaround can go away if/when we switch to a dynamically linked GHCi. --- rts/posix/Signals.c | 8 +++++++- rts/posix/Signals.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'rts/posix') diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c index 660065734b..aa7877452b 100644 --- a/rts/posix/Signals.c +++ b/rts/posix/Signals.c @@ -124,6 +124,12 @@ ioManagerDie (void) } } +Capability * +ioManagerStartCap (Capability *cap) +{ + return rts_evalIO(cap,&base_GHCziConc_ensureIOManagerIsRunning_closure,NULL); +} + void ioManagerStart (void) { @@ -131,7 +137,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 4d0a5a5fc7..b80f711b17 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 -- cgit v1.2.1