mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02:00
fixed lock issue
This commit is contained in:
@@ -90,9 +90,10 @@ namespace Wox.Plugin.Program
|
|||||||
|
|
||||||
public static void IndexWin32Programs()
|
public static void IndexWin32Programs()
|
||||||
{
|
{
|
||||||
|
var win32S = Win32.All(_settings);
|
||||||
lock (IndexLock)
|
lock (IndexLock)
|
||||||
{
|
{
|
||||||
_win32s = Win32.All(_settings);
|
_win32s = win32S;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,17 +102,18 @@ namespace Wox.Plugin.Program
|
|||||||
var windows10 = new Version(10, 0);
|
var windows10 = new Version(10, 0);
|
||||||
var support = Environment.OSVersion.Version.Major >= windows10.Major;
|
var support = Environment.OSVersion.Version.Major >= windows10.Major;
|
||||||
|
|
||||||
|
var applications = support ? UWP.All() : new UWP.Application[] { };
|
||||||
lock (IndexLock)
|
lock (IndexLock)
|
||||||
{
|
{
|
||||||
_uwps = support ? UWP.All() : new UWP.Application[] { };
|
_uwps = applications;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void IndexPrograms()
|
public static void IndexPrograms()
|
||||||
{
|
{
|
||||||
var t1 = Task.Run(() => { IndexWin32Programs(); });
|
var t1 = Task.Run(IndexWin32Programs);
|
||||||
|
|
||||||
var t2 = Task.Run(() => { IndexUWPPrograms(); });
|
var t2 = Task.Run(IndexUWPPrograms);
|
||||||
|
|
||||||
Task.WaitAll(t1, t2);
|
Task.WaitAll(t1, t2);
|
||||||
|
|
||||||
|
|||||||
@@ -165,9 +165,9 @@ namespace Wox.Plugin.Program.Programs
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if DEBUG //make developer aware and implement handling
|
#if DEBUG //make developer aware and implement handling
|
||||||
catch(Exception e)
|
catch
|
||||||
{
|
{
|
||||||
throw e;
|
throw;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return u.Apps;
|
return u.Apps;
|
||||||
@@ -230,8 +230,7 @@ namespace Wox.Plugin.Program.Programs
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
var uwp = obj as UWP;
|
if (obj is UWP uwp)
|
||||||
if (uwp != null)
|
|
||||||
{
|
{
|
||||||
return FamilyName.Equals(uwp.FamilyName);
|
return FamilyName.Equals(uwp.FamilyName);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user