From 0fe8238d1623544e3ca99d9b2db6a12488861898 Mon Sep 17 00:00:00 2001 From: Andy Adshead Date: Sat, 2 Feb 2019 03:22:49 +0000 Subject: [PATCH] Sometimes it would have to wait a long time for lock to clear so moved it to a tryenter and skip if already locked --- Ryujinx.Profiler/InternalProfile.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Ryujinx.Profiler/InternalProfile.cs b/Ryujinx.Profiler/InternalProfile.cs index 75f9581e54..1dcc4ed462 100644 --- a/Ryujinx.Profiler/InternalProfile.cs +++ b/Ryujinx.Profiler/InternalProfile.cs @@ -150,10 +150,11 @@ namespace Ryujinx.Profiler { _preserve = PerformanceCounter.ElapsedTicks; - // Make sure to clear queue - lock (_timerQueueClearLock) + // Skip clearing queue if already clearing + if (Monitor.TryEnter(_timerQueueClearLock)) { ClearTimerQueue(); + Monitor.Exit(_timerQueueClearLock); } return Timers;