Bug 915167 - Don't create helper threads when GetCPUCount() == 1 (r=bhackett)

--HG--
extra : rebase_source : 2bdf6c0df177361d004f63162dbe219665a3a269
This commit is contained in:
Luke Wagner 2013-09-11 09:52:16 -05:00
parent 442973e54e
commit b6645f5b3a

View File

@ -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;