mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
fix concurrency issue (really potentially)
This commit is contained in:
parent
4a0ee9b4fc
commit
e9d8579bbd
1 changed files with 5 additions and 3 deletions
|
|
@ -91,9 +91,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything
|
||||||
|
|
||||||
public static async ValueTask<bool> IsEverythingRunningAsync(CancellationToken token = default)
|
public static async ValueTask<bool> IsEverythingRunningAsync(CancellationToken token = default)
|
||||||
{
|
{
|
||||||
|
await _semaphore.WaitAsync(token);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _semaphore.WaitAsync(token);
|
|
||||||
EverythingApiDllImport.Everything_GetMajorVersion();
|
EverythingApiDllImport.Everything_GetMajorVersion();
|
||||||
var result = EverythingApiDllImport.Everything_GetLastError() != StateCode.IPCError;
|
var result = EverythingApiDllImport.Everything_GetLastError() != StateCode.IPCError;
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -119,10 +120,11 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything
|
||||||
if (option.MaxCount < 0)
|
if (option.MaxCount < 0)
|
||||||
throw new ArgumentOutOfRangeException(nameof(option.MaxCount), option.MaxCount, "MaxCount must be greater than or equal to 0");
|
throw new ArgumentOutOfRangeException(nameof(option.MaxCount), option.MaxCount, "MaxCount must be greater than or equal to 0");
|
||||||
|
|
||||||
|
await _semaphore.WaitAsync(token);
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _semaphore.WaitAsync(token);
|
|
||||||
|
|
||||||
if (token.IsCancellationRequested)
|
if (token.IsCancellationRequested)
|
||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue