Add IsAny feature to AsyncMutex.
MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -627,6 +627,8 @@ namespace WalletWasabi.Gui
Logger.LogInfo($"{nameof(TorManager)} is stopped.", nameof(Global));
}
+ if (AsyncMutex.IsAny)
+ {
try
{
await AsyncMutex.WaitForAllMutexToCloseAsync();
@@ -637,6 +639,7 @@ namespace WalletWasabi.Gui
Logger.LogError($"Error during stopping {nameof(AsyncMutex)}: {ex}", nameof(Global));
}
}
+ }
catch (Exception ex)
{
Logger.LogWarning(ex, nameof(Global));

MODIFY
WalletWasabi/Nito/AsyncEx/AsyncMutex.cs
WalletWasabi/Nito/AsyncEx/AsyncMutex.cs
@@ -61,6 +61,14 @@ namespace Nito.AsyncEx
private static object AsyncMutexesLock { get; } = new object();
+ public static bool IsAny
+ {
+ get
+ {
+ return AsyncMutexes.Any();
+ }
+ }
+
public AsyncMutex(string name)
{
// https://docs.microsoft.com/en-us/dotnet/api/system.threading.mutex?view=netframework-4.8

Add IsAny feature to AsyncMutex.