Basically reverting https://github.com/dotnet/coreclr/pull/26806
processorCount = systemInfo.dwNumberOfProcessors;
}
+#ifdef FEATURE_PAL
+ uint32_t cpuLimit;
+
+ if (PAL_GetCpuLimit(&cpuLimit) && cpuLimit < (uint32_t)processorCount)
+ processorCount = cpuLimit;
+#endif
+
END_QCALL;
return processorCount;
{
return 0;
}
+
+ UINT cpuLimit;
+ if (PAL_GetCpuLimit(&cpuLimit) && cpuLimit < dwNumberOfProcessors)
+ {
+ dwNumberOfProcessors = cpuLimit;
+ }
}
if (getrusage(RUSAGE_SELF, &resUsage) == -1)
#else // !FEATURE_PAL
count = PAL_GetLogicalCpuCountFromOS();
+
+ uint32_t cpuLimit;
+ if (PAL_GetCpuLimit(&cpuLimit) && cpuLimit < count)
+ count = cpuLimit;
#endif // !FEATURE_PAL
cCPUs = count;