mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
ThreadingHelper: Use Environment.ProcessorCount instead of SystemInfo.processorCount
This commit is contained in:
1 parent
4311115788
commit
a41c082481
1 file changed
+1
-1
@@ -214,7 +214,7 @@ namespace BepInEx
|
|||||||
public static IEnumerable<TOut> RunParallel<TIn, TOut>(this IList<TIn> data, Func<TIn, TOut> work, int workerCount = -1)
|
public static IEnumerable<TOut> RunParallel<TIn, TOut>(this IList<TIn> data, Func<TIn, TOut> work, int workerCount = -1)
|
||||||
{
|
{
|
||||||
if (workerCount < 0)
|
if (workerCount < 0)
|
||||||
workerCount = Mathf.Max(2, SystemInfo.processorCount);
|
workerCount = Mathf.Max(2, Environment.ProcessorCount);
|
||||||
else if (workerCount == 0)
|
else if (workerCount == 0)
|
||||||
throw new ArgumentException("Need at least 1 worker", nameof(workerCount));
|
throw new ArgumentException("Need at least 1 worker", nameof(workerCount));
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user