diff options
-rw-r--r-- | includes/rts/Threads.h | 4 | ||||
-rw-r--r-- | rts/Schedule.c | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/includes/rts/Threads.h b/includes/rts/Threads.h index 061e38b32b..dd533bedf8 100644 --- a/includes/rts/Threads.h +++ b/includes/rts/Threads.h @@ -61,10 +61,6 @@ extern Capability MainCapability; // Change the number of capabilities (only supports increasing the // current value at the moment). // -#if defined(THREADED_RTS) extern void setNumCapabilities (nat new); -#else -extern void setNumCapabilities (nat new) GNU_ATTRIBUTE(__noreturn__); -#endif #endif /* RTS_THREADS_H */ 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; |