Imported Upstream version 5.20.0.244

Former-commit-id: 072cb2ad8e168458108970d47c6dafefb04475eb
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-03-08 08:37:50 +00:00
parent 4b878ebc4f
commit f4a99b8ed9
56 changed files with 90 additions and 58 deletions

View File

@ -177,12 +177,17 @@ namespace MonoTests.System.Threading
[Test]
public void GetAvailableThreads ()
{
int cpuCount = Environment.ProcessorCount;
if (cpuCount > 16)
Assert.Inconclusive ("This test doesn't work well with a high number of processor cores.");
ManualResetEvent mre = new ManualResetEvent (false);
var sw = Stopwatch.StartNew ();
int i, workerThreads, completionPortThreads;
try {
Assert.IsTrue (ThreadPool.SetMaxThreads (Environment.ProcessorCount, Environment.ProcessorCount));
Assert.IsTrue (ThreadPool.SetMaxThreads (cpuCount, cpuCount));
while (true) {
ThreadPool.GetAvailableThreads (out workerThreads, out completionPortThreads);