Sometimes it would have to wait a long time for lock to clear so moved it to a tryenter and skip if already locked

This commit is contained in:
Andy Adshead 2019-02-02 03:22:49 +00:00
parent 5f3a9eade8
commit 0fe8238d16

View file

@ -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;