diff --git a/DotMP/Parallel.cs b/DotMP/Parallel.cs index f46ab2d..a64ae99 100644 --- a/DotMP/Parallel.cs +++ b/DotMP/Parallel.cs @@ -1425,7 +1425,7 @@ public static int GetNumThreads() { var freg = new ForkedRegion(); - return (freg.reg is not null) + return freg.in_parallel ? (int)freg.reg.num_threads : 1; }