query the online, not total, CPUs in case some were shut off

This commit is contained in:
Rudolf Polzer 2012-03-03 17:31:03 +01:00
parent 123f3fd962
commit dba712acf6

View File

@ -434,8 +434,8 @@ void ThreadSetDefault (void)
{
if (numthreads == -1) // not set manually
{
#ifdef _SC_NPROCESSORS_CONF
long cpus = sysconf(_SC_NPROCESSORS_CONF);
#ifdef _SC_NPROCESSORS_ONLN
long cpus = sysconf(_SC_NPROCESSORS_ONLN);
if (cpus > 0)
numthreads = cpus;
else