diff options
author | Guillaume B <gboucher90@users.noreply.github.com> | 2017-07-21 14:08:11 +0200 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2017-07-21 14:08:11 +0200 |
commit | df214e67d3cbccb42d2733f4cbe8097a378a731a (patch) | |
tree | a0cf5dac96b96b590853ea096bebbabe7d62a521 /src/classlibnative | |
parent | e6865018d91fd257f05a42fe4fe353beb32c641a (diff) | |
download | coreclr-df214e67d3cbccb42d2733f4cbe8097a378a731a.tar.gz coreclr-df214e67d3cbccb42d2733f4cbe8097a378a731a.tar.bz2 coreclr-df214e67d3cbccb42d2733f4cbe8097a378a731a.zip |
Add CGroup CFS CPU limit support (#12797)
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 f6a19f97d1..4e13bd1876 100644 --- a/src/classlibnative/bcltype/system.cpp +++ b/src/classlibnative/bcltype/system.cpp @@ -369,6 +369,13 @@ INT32 QCALLTYPE SystemNative::GetProcessorCount() processorCount = systemInfo.dwNumberOfProcessors; } +#ifdef FEATURE_PAL + uint32_t cpuLimit; + + if (PAL_GetCpuLimit(&cpuLimit) && cpuLimit < processorCount) + processorCount = cpuLimit; +#endif + END_QCALL; return processorCount; |