misc: give various threads dedicated names

Move all title ID lists into a TitleIDs class in Ryujinx.Common, with helpers.
Unify & simplify Auto graphics backend selection logic
This commit is contained in:
Evan Husted 2024-12-26 00:29:00 -06:00
parent 2bf48f57d2
commit 17233d30da
8 changed files with 212 additions and 209 deletions

View file

@ -1,4 +1,5 @@
using ARMeilleure.State;
using Humanizer;
using Ryujinx.Common;
using Ryujinx.Common.Logging;
using Ryujinx.Common.Memory;
@ -58,8 +59,8 @@ namespace ARMeilleure.Translation.PTC
{
_ptc = ptc;
_timer = new Timer(SaveInterval * 1000d);
_timer.Elapsed += PreSave;
_timer = new Timer(SaveInterval.Seconds());
_timer.Elapsed += TimerElapsed;
_outerHeaderMagic = BinaryPrimitives.ReadUInt64LittleEndian(EncodingCache.UTF8NoBOM.GetBytes(OuterHeaderMagicString).AsSpan());
@ -72,6 +73,9 @@ namespace ARMeilleure.Translation.PTC
Enabled = false;
}
private void TimerElapsed(object _, ElapsedEventArgs __)
=> new Thread(PreSave) { Name = "Ptc.DiskWriter" }.Start();
public void AddEntry(ulong address, ExecutionMode mode, bool highCq)
{
if (IsAddressInStaticCodeRange(address))
@ -262,7 +266,7 @@ namespace ARMeilleure.Translation.PTC
compressedStream.SetLength(0L);
}
private void PreSave(object source, ElapsedEventArgs e)
private void PreSave()
{
_waitEvent.Reset();
@ -428,7 +432,7 @@ namespace ARMeilleure.Translation.PTC
{
_disposed = true;
_timer.Elapsed -= PreSave;
_timer.Elapsed -= TimerElapsed;
_timer.Dispose();
Wait();