diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h index c1c1f809c86..31d5c8ce1b3 100644 --- a/js/src/vm/Runtime.h +++ b/js/src/vm/Runtime.h @@ -1602,8 +1602,10 @@ struct JSRuntime : public JS::shadow::Runtime, /* Number of helper threads which should be created for this runtime. */ size_t helperThreadCount() const { #ifdef JS_WORKER_THREADS - if (requestedHelperThreadCount < 0) - return js::GetCPUCount(); + if (requestedHelperThreadCount < 0) { + unsigned ncpus = js::GetCPUCount(); + return ncpus == 1 ? 0 : ncpus; + } return requestedHelperThreadCount; #else return 0;