summaryrefslogtreecommitdiff
path: root/rts/Schedule.c
diff options
context:
space:
mode:
authorAndreas Voellmy <andreas.voellmy@gmail.com>2012-12-22 19:38:21 -0500
committerJohan Tibell <johan.tibell@gmail.com>2013-02-11 21:38:36 -0800
commit24733b8f9bf27b2ebaf06a411a8bd95a01138651 (patch)
tree99b3c92a1e42267408eac2ce0e8b03a7dd1a65fe /rts/Schedule.c
parent38a5902fec5ca7b078f607cc4e7452f1c62214f7 (diff)
downloadhaskell-24733b8f9bf27b2ebaf06a411a8bd95a01138651.tar.gz
setNumCapabilities calls GHC.Conc.IO.ioManagerCapabilitiesChanged before returning.
This enables the IO manager to change the number of IO loops it uses (usually one per capability).
Diffstat (limited to 'rts/Schedule.c')
-rw-r--r--rts/Schedule.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c
index 5f48ef633c..7eaaba2483 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -2067,6 +2067,14 @@ setNumCapabilities (nat new_n_capabilities USED_IF_THREADS)
stgFree(old_capabilities);
}
+ // Notify IO manager that the number of capabilities has changed.
+ rts_evalIO(
+ &cap,
+ rts_apply(cap,
+ &base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure,
+ rts_mkInt(cap, enabled_capabilities)),
+ NULL);
+
rts_unlock(cap);
#endif // THREADED_RTS