mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-13 14:19:12 +00:00
Address Feedback
This commit is contained in:
parent
d684e380a1
commit
d782d57ca4
2 changed files with 5 additions and 8 deletions
|
@ -105,6 +105,7 @@ namespace ARMeilleure.Translation
|
|||
public void Execute(State.ExecutionContext context, ulong address)
|
||||
{
|
||||
int physicalCoreCount = SystemInfo.GetPhysicalCoreCount();
|
||||
|
||||
if (Interlocked.Increment(ref _threadCount) == 1)
|
||||
{
|
||||
IsReadyForTranslation.WaitOne();
|
||||
|
|
|
@ -94,17 +94,11 @@ namespace Ryujinx.Common.SystemInfo
|
|||
}
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
string cpuCoresLine = File.ReadLines("/proc/cpuinfo")
|
||||
.FirstOrDefault(line => line.Contains("cpu cores"));
|
||||
string cpuCoresLine = File.ReadLines("/proc/cpuinfo").FirstOrDefault(line => line.Contains("cpu cores"));
|
||||
|
||||
if (cpuCoresLine != null)
|
||||
{
|
||||
string[] parts = cpuCoresLine.Split(':');
|
||||
if (parts.Length == 2 && int.TryParse(parts[1].Trim(), out int cores))
|
||||
{
|
||||
coreCount = cores;
|
||||
Console.WriteLine("Number of physical cores: " + coreCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
|
@ -122,13 +116,15 @@ namespace Ryujinx.Common.SystemInfo
|
|||
};
|
||||
|
||||
process.Start();
|
||||
|
||||
coreCount = int.Parse(process.StandardOutput.ReadToEnd());
|
||||
|
||||
process.WaitForExit();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("An error occurred while trying to get the physical core count: " + ex.Message);
|
||||
Logger.Error?.Print(LogClass.Application,"An error occurred while trying to get the physical core count: {ex.Message}");
|
||||
}
|
||||
|
||||
return coreCount;
|
||||
|
|
Loading…
Reference in a new issue