From 5115f379fc240b1250220910b14d69bb27a32c1e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Wed, 16 Jun 2021 16:00:50 +0200 Subject: using try/finally to ensure mutexes release --- Samples/DebugLogAnalyzer/src/DebugInterface.cs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'Samples/DebugLogAnalyzer/src/DebugInterface.cs') diff --git a/Samples/DebugLogAnalyzer/src/DebugInterface.cs b/Samples/DebugLogAnalyzer/src/DebugInterface.cs index 1653f163..64de2163 100644 --- a/Samples/DebugLogAnalyzer/src/DebugInterface.cs +++ b/Samples/DebugLogAnalyzer/src/DebugInterface.cs @@ -43,13 +43,28 @@ namespace Crow } catch (System.Exception ex) { - while (Monitor.IsEntered(LayoutMutex)) + while (Monitor.IsEntered(LayoutMutex)) { + Console.WriteLine ($"[DebugIFace] trying to exit LayoutMutex on error"); + Monitor.Exit (LayoutMutex); + } + while (Monitor.IsEntered(UpdateMutex)) { + Console.WriteLine ($"[DebugIFace] trying to exit UpdateMutex on error"); + Monitor.Exit (UpdateMutex); + } + while (Monitor.IsEntered(ClippingMutex)) { + Console.WriteLine ($"[DebugIFace] trying to exit ClippingMutex on error"); + Monitor.Exit (ClippingMutex); + } + + + /*while (Monitor.IsEntered(LayoutMutex)) Monitor.Exit (LayoutMutex); while (Monitor.IsEntered(UpdateMutex)) Monitor.Exit (UpdateMutex); while (Monitor.IsEntered(ClippingMutex)) - Monitor.Exit (ClippingMutex); - delSetCurrentException (ex); + Monitor.Exit (ClippingMutex);*/ + delSetCurrentException (ex); + Console.WriteLine ($"[DbgIFace] {ex}"); ClearInterface(); Thread.Sleep(1000); } -- cgit v1.3.1-4-g156e