diff --git a/src/fsharp/FSharp.Core/control.fs b/src/fsharp/FSharp.Core/control.fs index 28986c052fbefa5af91ab25f8d478cbf611b43d6..9283a134baf0619c77bf2bd61cdc57aeafc66273 100644 --- a/src/fsharp/FSharp.Core/control.fs +++ b/src/fsharp/FSharp.Core/control.fs @@ -2084,9 +2084,8 @@ namespace Microsoft.FSharp.Control // If it isn't, then create it, and go back to the start to // check arrivals again. match pulse with - | null -> - if timeout >= 0 || cancellationSupported then - ensurePulse() |> ignore + | null when timeout >= 0 || cancellationSupported -> + ensurePulse() |> ignore return! processFirstArrival() | _ -> // Wait until we have been notified about a message. When that happens, rescan the arrivals diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 9468f8a6e66d53295a7262145a215e1aeaefa305..bed7c7c604ea9f3fb8da157f03f214143ea46caf 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -352,7 +352,9 @@ and while true do let! siteProvider = inbox.Receive() do! Async.SwitchToContext ctx - this.SetupProjectFile(siteProvider, this.Workspace, "SetupProjectsAfterSolutionOpen") } + this.SetupProjectFile(siteProvider, this.Workspace, "SetupProjectsAfterSolutionOpen") + do! Async.SwitchToThreadPool() + } use _ = Events.SolutionEvents.OnAfterOpenProject |> Observable.subscribe ( fun args -> match args.Hierarchy with