Assign names to threads

Visible in debuggers etc
This commit is contained in:
PJB3005
2026-03-14 14:16:49 +01:00
parent 002a34f18b
commit dca0964f27
7 changed files with 76 additions and 0 deletions
+7
View File
@@ -14,6 +14,8 @@
#include <chrono>
#include <thread>
#include "dusk/os.h"
#if PLATFORM_GCN
const int stack_size = 3072;
#else
@@ -65,6 +67,11 @@ static void mDoDvdErr_Watch(void*) {
OSDisableInterrupts();
#endif
#endif
#if TARGET_PC
OSSetCurrentThreadName("DVD error thread");
#endif
JKRThread(OSGetCurrentThread(), 0);
JKRSetCurrentHeap(mDoExt_getAssertHeap());
+5
View File
@@ -10,6 +10,7 @@
#include "m_Do/m_Do_MemCardRWmng.h"
#include "m_Do/m_Do_Reset.h"
#include "os_report.h"
#include "dusk/os.h"
#if PLATFORM_WII || PLATFORM_SHIELD
#include <revolution/nand.h>
@@ -866,6 +867,10 @@ mDoMemCd_Ctrl_c g_mDoMemCd_control;
static int mDoMemCd_main(void*) {
JKRThread(OSGetCurrentThread(), 0);
#if TARGET_PC
OSSetCurrentThreadName("MemCardThread");
#endif
JKRSetCurrentHeap(mDoExt_getAssertHeap());
g_mDoMemCd_control.main();
+4
View File
@@ -10,6 +10,7 @@
#include "JSystem/JKernel/JKRDvdRipper.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/JKernel/JKRMemArchive.h"
#include "dusk/os.h"
#include "m_Do/m_Do_Reset.h"
#include "m_Do/m_Do_controller_pad.h"
#include "m_Do/m_Do_ext.h"
@@ -17,6 +18,9 @@
s32 mDoDvdThd::main(void* param_0) {
JKRThread(OSGetCurrentThread(), 0);
#if TARGET_PC
OSSetCurrentThreadName("DVD thread");
#endif
JKRSetCurrentHeap(mDoExt_getAssertHeap());
mDoDvdThd_param_c* param = static_cast<mDoDvdThd_param_c*>(param_0);
param->mainLoop();