diff options
author | Vladimir Sadov <vsadov@microsoft.com> | 2020-01-14 19:31:01 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-14 19:31:01 -0800 |
commit | c43d0336eb999fe3bc7bf5873effe89cee716c69 (patch) | |
tree | 77fdd42e9c6da72035ee7773353e3f847bc92104 /src/classlibnative | |
parent | 2f99ca8652bd31755aac431dc1bff8a4dda888eb (diff) | |
download | coreclr-c43d0336eb999fe3bc7bf5873effe89cee716c69.tar.gz coreclr-c43d0336eb999fe3bc7bf5873effe89cee716c69.tar.bz2 coreclr-c43d0336eb999fe3bc7bf5873effe89cee716c69.zip |
Revert CPU clipping in the presence of CPU quota to 3.0, 2.x behavior.
Basically reverting https://github.com/dotnet/coreclr/pull/26806
Diffstat (limited to 'src/classlibnative')
-rw-r--r-- | src/classlibnative/bcltype/system.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/classlibnative/bcltype/system.cpp b/src/classlibnative/bcltype/system.cpp index 402a215e9f..e38f7db292 100644 --- a/src/classlibnative/bcltype/system.cpp +++ b/src/classlibnative/bcltype/system.cpp @@ -352,6 +352,13 @@ INT32 QCALLTYPE SystemNative::GetProcessorCount() processorCount = systemInfo.dwNumberOfProcessors; } +#ifdef FEATURE_PAL + uint32_t cpuLimit; + + if (PAL_GetCpuLimit(&cpuLimit) && cpuLimit < (uint32_t)processorCount) + processorCount = cpuLimit; +#endif + END_QCALL; return processorCount; |