Skip to content

Commit

Permalink
Fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewvk committed Aug 30, 2020
1 parent 133f0a6 commit 2868a56
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CodeJam.Main/Threading/TaskHelper.ForEachAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,20 @@ private static int ProcessorCount
}
}

#if NETSTANDARD20_OR_GREATER || NET45_OR_GREATER || TARGETS_NETCOREAPP
/// <summary>
/// Gets the maximum degree of parallelism for the scheduler.
/// Matches to the <see cref="Parallel.ForEach{TSource}(IEnumerable{TSource}, Action{TSource})"/> behavior.
/// Limits <paramref name="value"/> by <see cref="TaskScheduler.MaximumConcurrencyLevel"/> value (if non-zero positiver value).
/// Otherwise, uses <see cref="Environment.ProcessorCount"/> as fallback value.
/// </summary>
#else
/// <summary>
/// Gets the maximum degree of parallelism for the scheduler.
/// Limits <paramref name="value"/> by <see cref="TaskScheduler.MaximumConcurrencyLevel"/> value (if non-zero positiver value).
/// Otherwise, uses <see cref="Environment.ProcessorCount"/> as fallback value.
/// </summary>
#endif
public static int GetMaxDegreeOfParallelism([NotNull] this TaskScheduler scheduler, int value)
{
Code.NotNull(scheduler, nameof(scheduler));
Expand Down

0 comments on commit 2868a56

Please sign in to comment.