summaryrefslogtreecommitdiff
path: root/rts/Schedule.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2016-10-28 16:34:44 +0100
committerSimon Marlow <marlowsd@gmail.com>2016-10-28 20:14:41 +0100
commitaae2b3d522aae49311a9f9c52d40fb58c99eed13 (patch)
tree75a592b689125fa12d942eca925a57d28a15a3e7 /rts/Schedule.c
parent7187dedabec8e01394578c9f40241ca3d644a4f8 (diff)
downloadhaskell-aae2b3d522aae49311a9f9c52d40fb58c99eed13.tar.gz
Make it possible to use +RTS -qn without -N
It's entirely reasonable to set +RTS -qn without setting -N, because the program might later call setNumCapabilities. If we disallow it, there's no way to use -qn on programs that use setNumCapabilities.
Diffstat (limited to 'rts/Schedule.c')
-rw-r--r--rts/Schedule.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c
index 06db3fe81f..a44512b3cb 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -1596,7 +1596,11 @@ scheduleDoGC (Capability **pcap, Task *task USED_IF_THREADS,
// enabled_capabilities may change if requestSync() below fails and
// we retry.
if (gc_type == SYNC_GC_PAR && n_gc_threads > 0) {
- need_idle = stg_max(0, enabled_capabilities - n_gc_threads);
+ if (n_gc_threads >= enabled_capabilities) {
+ need_idle = 0;
+ } else {
+ need_idle = enabled_capabilities - n_gc_threads;
+ }
} else {
need_idle = 0;
}