This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -352,6 +352,13 @@ INT32 QCALLTYPE SystemNative::GetProcessorCount()
352
352
processorCount = systemInfo.dwNumberOfProcessors ;
353
353
}
354
354
355
+ #ifdef FEATURE_PAL
356
+ uint32_t cpuLimit;
357
+
358
+ if (PAL_GetCpuLimit (&cpuLimit) && cpuLimit < (uint32_t )processorCount)
359
+ processorCount = cpuLimit;
360
+ #endif
361
+
355
362
END_QCALL;
356
363
357
364
return processorCount;
Original file line number Diff line number Diff line change @@ -2558,6 +2558,12 @@ PAL_GetCPUBusyTime(
2558
2558
{
2559
2559
return 0 ;
2560
2560
}
2561
+
2562
+ UINT cpuLimit;
2563
+ if (PAL_GetCpuLimit (&cpuLimit) && cpuLimit < dwNumberOfProcessors)
2564
+ {
2565
+ dwNumberOfProcessors = cpuLimit;
2566
+ }
2561
2567
}
2562
2568
2563
2569
if (getrusage (RUSAGE_SELF, &resUsage) == -1 )
Original file line number Diff line number Diff line change @@ -1289,6 +1289,10 @@ int GetCurrentProcessCpuCount()
1289
1289
1290
1290
#else // !FEATURE_PAL
1291
1291
count = PAL_GetLogicalCpuCountFromOS ();
1292
+
1293
+ uint32_t cpuLimit;
1294
+ if (PAL_GetCpuLimit (&cpuLimit) && cpuLimit < count)
1295
+ count = cpuLimit;
1292
1296
#endif // !FEATURE_PAL
1293
1297
1294
1298
cCPUs = count;
You can’t perform that action at this time.
0 commit comments