Skip to content

Commit 8c77c0c

Browse files
committed
sequential
1 parent 27dd989 commit 8c77c0c

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/Compiler/Facilities/DiagnosticsLogger.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,7 @@ type StackGuard(maxDepth: int, name: string) =
895895
GetEnvInteger ("FSHARP_" + name + "StackGuardDepth") StackGuard.DefaultDepth
896896

897897
module MultipleDiagnosticsLoggers =
898+
898899
let Parallel computations =
899900
let computationsWithLoggers, diagnosticsReady =
900901
[
@@ -942,6 +943,8 @@ module MultipleDiagnosticsLoggers =
942943
let results = ResizeArray()
943944

944945
for computation in computations do
946+
// Encapsulate computation's diagnostics scope.
947+
use _ = new CompilationGlobalsScope()
945948
let! result = computation
946949
results.Add result
947950

src/Compiler/Facilities/DiagnosticsLogger.fsi

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -474,12 +474,13 @@ type CompilationGlobalsScope =
474474

475475
module MultipleDiagnosticsLoggers =
476476

477-
/// Execute computations using Async.Parallel.
478-
/// Captures the diagnostics in correct order and keeps a common error count for all computations.
479-
/// When done, restores caller's build phase and diagnostics logger, commiting captured diagnostics.
477+
/// Runs computations using Async.Parallel.
478+
/// Capturing the diagnostics from each separately.
479+
/// When done, restores caller's BuildPhase and DiagnosticsLogger
480+
/// and commits captured diagnostics preserving the order.
480481
val Parallel: computations: Async<'T> seq -> Async<'T array>
481482

482-
/// Execute computations using Async.Sequential.
483-
/// Captures the diagnostics in correct order and keeps a common error count for all computations.
484-
/// When done, restores caller's build phase and diagnostics logger, commiting captured diagnostics.
483+
/// Run computations sequentially starting on current thread
484+
/// using caller's DiagnosticsLogger and BuildPhase for each computation.
485+
/// When done, restores caller's BuildPhase and DiagnosticsLogger.
485486
val Sequential: computations: Async<'T> seq -> Async<'T array>

0 commit comments

Comments
 (0)