Name all threads

Close #874
This commit is contained in:
Ac_K 2020-01-12 22:48:38 +01:00
parent 88f78ae6c8
commit be69a2cefc
10 changed files with 37 additions and 11 deletions

View file

@ -58,9 +58,12 @@ namespace ARMeilleure.Translation
{
if (Interlocked.Increment(ref _threadCount) == 1)
{
Thread backgroundTranslatorThread = new Thread(TranslateQueuedSubs);
Thread backgroundTranslatorThread = new Thread(TranslateQueuedSubs)
{
Name = "CPU.BackgroundTranslatorThread",
Priority = ThreadPriority.Lowest
};
backgroundTranslatorThread.Priority = ThreadPriority.Lowest;
backgroundTranslatorThread.Start();
}

View file

@ -70,7 +70,10 @@ namespace Ryujinx.Audio
_context = new AudioContext();
_tracks = new ConcurrentDictionary<int, OpenALAudioTrack>();
_keepPolling = true;
_audioPollerThread = new Thread(AudioPollerWork);
_audioPollerThread = new Thread(AudioPollerWork)
{
Name = "Audio.PollerThread"
};
_audioPollerThread.Start();
}

View file

@ -57,6 +57,7 @@ namespace Ryujinx.Common.Logging
}
});
_messageThread.Name = "Logger.MessageThread";
_messageThread.IsBackground = true;
_messageThread.Start();
}

View file

@ -33,7 +33,10 @@ namespace Ryujinx.HLE.HOS.Kernel.Common
_keepRunning = true;
Thread work = new Thread(WaitAndCheckScheduledObjects);
Thread work = new Thread(WaitAndCheckScheduledObjects)
{
Name = "HLE.TimeManager"
};
work.Start();
}

View file

@ -17,7 +17,10 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
public void StartAutoPreemptionThread()
{
Thread preemptionThread = new Thread(PreemptCurrentThread);
Thread preemptionThread = new Thread(PreemptCurrentThread)
{
Name = "HLE.PreemptionThread"
};
_keepPreempting = true;

View file

@ -159,7 +159,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
is64Bits = true;
}
HostThread = new Thread(customHostThreadStart == null ? () => ThreadStart(entrypoint) : customHostThreadStart);
HostThread = new Thread(customHostThreadStart ?? (() => ThreadStart(entrypoint)));
Context = new ARMeilleure.State.ExecutionContext();
@ -185,7 +185,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
ThreadUid = System.GetThreadUid();
HostThread.Name = $"Host Thread (thread id {ThreadUid})";
HostThread.Name = $"HLE.HostThread.{ThreadUid}";
_hasBeenInitialized = true;

View file

@ -55,7 +55,10 @@ namespace Ryujinx.Profiler
_cleanupRunning = true;
// Create cleanup thread.
_cleanupThread = new Thread(CleanupLoop);
_cleanupThread = new Thread(CleanupLoop)
{
Name = "Profiler.CleanupThread"
};
_cleanupThread.Start();
}

View file

@ -21,7 +21,10 @@ namespace Ryujinx.Profiler.UI
{
_profilerRunning = true;
_prevTime = 0;
_profileThread = new Thread(ProfileLoop);
_profileThread = new Thread(ProfileLoop)
{
Name = "Profiler.ProfileThread"
};
_profileThread.Start();
}
}
@ -60,7 +63,10 @@ namespace Ryujinx.Profiler.UI
using (_window = new ProfileWindow())
{
// Create thread for render loop
_renderThread = new Thread(RenderLoop);
_renderThread = new Thread(RenderLoop)
{
Name = "Profiler.RenderThread"
};
_renderThread.Start();
while (_profilerRunning)

View file

@ -120,7 +120,10 @@ namespace Ryujinx.Ui
Context.MakeCurrent(null);
// OpenTK doesn't like sleeps in its thread, to avoid this a renderer thread is created
_renderThread = new Thread(RenderLoop);
_renderThread = new Thread(RenderLoop)
{
Name = "GUI.RenderThread"
};
_renderThread.Start();

View file

@ -653,6 +653,7 @@ namespace Ryujinx.Ui
}
});
thread.Name = "GUI.FirmwareInstallerThread";
thread.Start();
}
else