Uses Interlocked.Increment over lock

This commit is contained in:
Andy Adshead 2019-04-26 00:40:45 +01:00
parent e71d7ede97
commit 7c46899e2a

View file

@ -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<KeyValuePair<ProfileConfig, TimingInfo>> GetProfilingData()