summaryrefslogtreecommitdiff
path: root/rts/posix
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-11-03 16:05:47 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-11-03 16:05:47 +0000
commit3501ac6af749ada0afcaf84f112ab2e4bf9120b9 (patch)
tree2afe6473e18531985cd92d872b45f4267c6158cb /rts/posix
parent7068f60cc7aefef514f02d5927d5abbdcd5c94d4 (diff)
downloadhaskell-3501ac6af749ada0afcaf84f112ab2e4bf9120b9.tar.gz
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.
Diffstat (limited to 'rts/posix')
-rw-r--r--rts/posix/Signals.c8
-rw-r--r--rts/posix/Signals.h2
2 files changed, 9 insertions, 1 deletions
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