Skip to content

Commit

Permalink
[Android] Enable ThreadPoolCanPickUpOneOrMoreWorkItemsWhenThreadIsAva…
Browse files Browse the repository at this point in the history
…ilable test (#73487)

* [Android] Enable ThreadPoolCanPickUpOneOrMoreWorkItemsWhenThreadIsAvailable test

* Tweak ThreadPoolTest when there is 1 core

Co-authored-by: Steve Pfister <[email protected]>
Co-authored-by: mdh1418 <[email protected]>
  • Loading branch information
3 people authored Aug 10, 2022
1 parent 177a721 commit ee5b738
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,6 @@ public static void RunProcessorCountItemsInParallel()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/43754", TestPlatforms.Android)]
public static void ThreadPoolCanPickUpOneOrMoreWorkItemsWhenThreadIsAvailable()
{
int processorCount = Environment.ProcessorCount;
Expand Down Expand Up @@ -629,7 +628,9 @@ public static void ThreadPoolCanPickUpOneOrMoreWorkItemsWhenThreadIsAvailable()
ThreadPool.QueueUserWorkItem(blockingWorkItem);
}

allBlockingWorkItemsStarted.CheckedWait();
if (processorCount > 1)
allBlockingWorkItemsStarted.CheckedWait();

for (int i = 0; i < processorCount; ++i)
{
ThreadPool.QueueUserWorkItem(testWorkItem);
Expand Down

0 comments on commit ee5b738

Please sign in to comment.