summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-01-06 11:26:31 +0000
committerSimon Marlow <marlowsd@gmail.com>2012-01-06 11:31:35 +0000
commita6969bf9236eb0497afbf3a27da2fe07e8e9175b (patch)
tree20aff305ea533043695518cf4886cdda16a24556 /rts
parent77e788960cad26bfdee00e0741d28fd7a78d9c22 (diff)
downloadhaskell-a6969bf9236eb0497afbf3a27da2fe07e8e9175b.tar.gz
setNumCapabilities: don't barf() if it isn't supported, just print an error
Diffstat (limited to 'rts')
-rw-r--r--rts/Schedule.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c
index 72b7217ebb..ce10852adb 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -1924,9 +1924,15 @@ void
setNumCapabilities (nat new_n_capabilities USED_IF_THREADS)
{
#if !defined(THREADED_RTS)
-
- barf("setNumCapabilities: not supported in the non-threaded RTS");
-
+ if (new_n_capabilities != 1) {
+ errorBelch("setNumCapabilities: not supported in the non-threaded RTS");
+ }
+ return;
+#elif defined(NOSMP)
+ if (new_n_capabilities != 1) {
+ errorBelch("setNumCapabilities: not supported on this platform");
+ }
+ return;
#else
Task *task;
Capability *cap;