From 11ca5f9bf370368f0402e950f9e6e8f358f76599 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Fri, 25 Jun 2021 14:43:47 +0800 Subject: [PATCH] revert unintended remove of await TaskScheduler.Default back --- Flow.Launcher/ViewModel/MainViewModel.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index c7d8fa4a2..262c1848b 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -482,6 +482,9 @@ namespace Flow.Launcher.ViewModel ProgressBarVisibility = Visibility.Hidden; _isQueryRunning = true; + // Switch to ThreadPool thread + await TaskScheduler.Default; + var query = QueryBuilder.Build(QueryText.Trim(), PluginManager.NonGlobalPlugins); // handle the exclusiveness of plugin using action keyword @@ -543,7 +546,7 @@ namespace Flow.Launcher.ViewModel // Local function async Task QueryTask(PluginPair plugin) { - // Since it is wrapped within a Task.Run, the synchronous context is null + // Since it is wrapped within a ThreadPool Thread, the synchronous context is null // Task.Yield will force it to run in ThreadPool await Task.Yield();