diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-06-16 16:00:50 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-06-16 16:00:50 +0200 |
| commit | 5115f379fc240b1250220910b14d69bb27a32c1e (patch) | |
| tree | 1818ebcf5f2f5bd2f9730d85391217fcd1038c92 /Samples/DebugLogAnalyzer/src/DebugInterface.cs | |
| parent | 58e1683bdbe1c169a1ab18b170283f8d171049a7 (diff) | |
using try/finally to ensure mutexes release
Diffstat (limited to 'Samples/DebugLogAnalyzer/src/DebugInterface.cs')
| -rw-r--r-- | Samples/DebugLogAnalyzer/src/DebugInterface.cs | 21 |
1 files changed, 18 insertions, 3 deletions
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); } |