From 7c46899e2a1b73bb2ad0d36d0fa385144507e5f8 Mon Sep 17 00:00:00 2001 From: Andy Adshead Date: Fri, 26 Apr 2019 00:40:45 +0100 Subject: [PATCH] Uses Interlocked.Increment over lock --- Ryujinx.Profiler/InternalProfile.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Ryujinx.Profiler/InternalProfile.cs b/Ryujinx.Profiler/InternalProfile.cs index d817f32e48..d5145ea0f9 100644 --- a/Ryujinx.Profiler/InternalProfile.cs +++ b/Ryujinx.Profiler/InternalProfile.cs @@ -172,11 +172,8 @@ namespace Ryujinx.Profiler public string GetSession() { - // Can be called from multiple threads so locked to ensure no duplicate sessions are generated - lock (_sessionLock) - { - return (_sessionCounter++).ToString(); - } + // Can be called from multiple threads so we need to ensure no duplicate sessions are generated + return Interlocked.Increment(ref _sessionCounter).ToString(); } public List> GetProfilingData()