提交 86fcbe34 编写于 作者: D Don Syme 提交者: GitHub

prevent endless async loop on Receive (#3498)

* prevent endless async loop on Receive

* don't run update loop on ui thread forever

* Update LanguageService.fs
上级 83ce8851
...@@ -2084,9 +2084,8 @@ namespace Microsoft.FSharp.Control ...@@ -2084,9 +2084,8 @@ namespace Microsoft.FSharp.Control
// If it isn't, then create it, and go back to the start to // If it isn't, then create it, and go back to the start to
// check arrivals again. // check arrivals again.
match pulse with match pulse with
| null -> | null when timeout >= 0 || cancellationSupported ->
if timeout >= 0 || cancellationSupported then ensurePulse() |> ignore
ensurePulse() |> ignore
return! processFirstArrival() return! processFirstArrival()
| _ -> | _ ->
// Wait until we have been notified about a message. When that happens, rescan the arrivals // Wait until we have been notified about a message. When that happens, rescan the arrivals
......
...@@ -352,7 +352,9 @@ and ...@@ -352,7 +352,9 @@ and
while true do while true do
let! siteProvider = inbox.Receive() let! siteProvider = inbox.Receive()
do! Async.SwitchToContext ctx 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 -> use _ = Events.SolutionEvents.OnAfterOpenProject |> Observable.subscribe ( fun args ->
match args.Hierarchy with match args.Hierarchy with
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册