Uses Interlocked.Increment over lock
This commit is contained in:
parent
e71d7ede97
commit
7c46899e2a
1 changed files with 2 additions and 5 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue