[threading] Change thread names to suit pthread

Shorten names to 16.
Rename Win32 to Windowing.
Shorten GraphicsSystem thread names due to 16 length limit of pthread.
Without this change, both show up as GraphicsSystem.
Remove redundant "Worker" and "Thread" from names.
Remove redundant thread handle from thread name.
This commit is contained in:
Sandy Carter 2019-01-27 10:48:31 -05:00 committed by Rick Gibbed
parent a503b6222f
commit 382dd8860f
6 changed files with 8 additions and 8 deletions

View File

@ -65,8 +65,8 @@ std::unique_ptr<EmulatorWindow> EmulatorWindow::Create(Emulator* emulator) {
std::unique_ptr<EmulatorWindow> emulator_window(new EmulatorWindow(emulator));
emulator_window->loop()->PostSynchronous([&emulator_window]() {
xe::threading::set_name("Win32 Loop");
xe::Profiler::ThreadEnter("Win32 Loop");
xe::threading::set_name("Windowing Loop");
xe::Profiler::ThreadEnter("Windowing Loop");
if (!emulator_window->Initialize()) {
xe::FatalError("Failed to initialize main window");

View File

@ -144,7 +144,7 @@ X_STATUS XmaDecoder::Setup(kernel::KernelState* kernel_state) {
WorkerThreadMain();
return 0;
}));
worker_thread_->set_name("XMA Decoder Worker");
worker_thread_->set_name("XMA Decoder");
worker_thread_->set_can_debugger_suspend(true);
worker_thread_->Create();

View File

@ -93,7 +93,7 @@ class Logger {
write_thread_ =
xe::threading::Thread::Create({}, [this]() { WriteThread(); });
write_thread_->set_name("xe::FileLogSink Writer");
write_thread_->set_name("Logging Writer");
}
~Logger() {

View File

@ -73,7 +73,7 @@ bool CommandProcessor::Initialize(
WorkerThreadMain();
return 0;
}));
worker_thread_->set_name("GraphicsSystem Command Processor");
worker_thread_->set_name("GPU Commands");
worker_thread_->Create();
return true;

View File

@ -135,7 +135,7 @@ X_STATUS GraphicsSystem::Setup(cpu::Processor* processor,
}));
// As we run vblank interrupts the debugger must be able to suspend us.
vsync_worker_thread_->set_can_debugger_suspend(true);
vsync_worker_thread_->set_name("GraphicsSystem Vsync");
vsync_worker_thread_->set_name("GPU VSync");
vsync_worker_thread_->Create();
if (cvars::trace_gpu_stream) {

View File

@ -245,7 +245,7 @@ object_ref<XThread> KernelState::LaunchModule(object_ref<UserModule> module) {
module->entry_point(), 0, X_CREATE_SUSPENDED, true, true));
// We know this is the 'main thread'.
thread->set_name(fmt::format("Main XThread{:08X}", thread->handle()));
thread->set_name("Main XThread");
X_STATUS result = thread->Create();
if (XFAILED(result)) {
@ -340,7 +340,7 @@ void KernelState::SetExecutableModule(object_ref<UserModule> module) {
}
return 0;
}));
dispatch_thread_->set_name("Kernel Dispatch Thread");
dispatch_thread_->set_name("Kernel Dispatch");
dispatch_thread_->Create();
}
}