File tree Expand file tree Collapse file tree 2 files changed +8
-27
lines changed Expand file tree Collapse file tree 2 files changed +8
-27
lines changed Original file line number Diff line number Diff line change @@ -872,35 +872,22 @@ let internal languageFeatureNotSupportedInLibraryError (langFeature: LanguageFea
872
872
type StackGuard ( maxDepth : int , name : string ) =
873
873
874
874
let mutable depth = 1
875
+ do ignore name
875
876
876
877
[<DebuggerHidden; DebuggerStepThrough>]
877
- member _.Guard
878
- (
879
- f ,
880
- [<CallerMemberName; Optional; DefaultParameterValue( " " ) >] memberName : string ,
881
- [<CallerFilePath; Optional; DefaultParameterValue( " " ) >] path : string ,
882
- [<CallerLineNumber; Optional; DefaultParameterValue( 0 ) >] line : int
883
- ) =
884
-
885
- Activity.addEventWithTags
886
- " DiagnosticsLogger.StackGuard.Guard"
887
- ( seq {
888
- Activity.Tags.stackGuardName, box name
889
- Activity.Tags.stackGuardCurrentDepth, depth
890
- Activity.Tags.stackGuardMaxDepth, maxDepth
891
- Activity.Tags.callerMemberName, memberName
892
- Activity.Tags.callerFilePath, path
893
- Activity.Tags.callerLineNumber, line
894
- })
878
+ member _.Guard f =
895
879
896
880
depth <- depth + 1
897
881
898
882
try
899
883
if depth % maxDepth = 0 then
900
884
901
885
async {
902
- do ! Async.SwitchToNewThread()
903
- Thread.CurrentThread.Name <- $" F# Extra Compilation Thread for {name} (depth {depth})"
886
+ if Environment.Is64BitProcess then
887
+ do ! Async.SwitchToThreadPool()
888
+ else
889
+ do ! Async.SwitchToNewThread()
890
+
904
891
return f ()
905
892
}
906
893
|> Async.RunImmediate
Original file line number Diff line number Diff line change @@ -463,13 +463,7 @@ type StackGuard =
463
463
new : maxDepth: int * name: string -> StackGuard
464
464
465
465
/// Execute the new function, on a new thread if necessary
466
- member Guard :
467
- f : ( unit -> 'T ) *
468
- [< CallerMemberName ; Optional ; DefaultParameterValue ( "")>] memberName : string *
469
- [< CallerFilePath ; Optional ; DefaultParameterValue ( "")>] path : string *
470
- [< CallerLineNumber ; Optional ; DefaultParameterValue ( 0 )>] line : int ->
471
- 'T
472
-
466
+ member Guard : f : ( unit -> 'T ) -> 'T
473
467
static member GetDepthOption : string -> int
474
468
475
469
/// This represents the global state established as each task function runs as part of the build.
You can’t perform that action at this time.
0 commit comments