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:
parent
5f3a9eade8
commit
0fe8238d16
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue