diff --git a/src/utils/BackgroundThreadWrapper.cpp b/src/utils/BackgroundThreadWrapper.cpp index ec4ecc6..e7c2eb1 100644 --- a/src/utils/BackgroundThreadWrapper.cpp +++ b/src/utils/BackgroundThreadWrapper.cpp @@ -1,7 +1,7 @@ #include "BackgroundThreadWrapper.hpp" #include -BackgroundThreadWrapper::BackgroundThreadWrapper(int32_t priority) : CThread(CThread::eAttributeAffCore2, priority, 0x100000) { +BackgroundThreadWrapper::BackgroundThreadWrapper(int32_t priority) : CThread(CThread::eAttributeAffCore2, priority, 0x100000, nullptr, nullptr, "FTPiiU Server") { } BackgroundThreadWrapper::~BackgroundThreadWrapper() { diff --git a/src/utils/CThread.h b/src/utils/CThread.h index be304ff..0f43168 100644 --- a/src/utils/CThread.h +++ b/src/utils/CThread.h @@ -21,6 +21,7 @@ #include #include #include +#include #include class CThread { @@ -28,7 +29,7 @@ public: typedef void (*Callback)(CThread *thread, void *arg); //! constructor - explicit CThread(int32_t iAttr, int32_t iPriority = 16, int32_t iStackSize = 0x8000, CThread::Callback callback = nullptr, void *callbackArg = nullptr) + explicit CThread(int32_t iAttr, int32_t iPriority = 16, int32_t iStackSize = 0x8000, CThread::Callback callback = nullptr, void *callbackArg = nullptr, const std::string &threadName = "") : pThread(nullptr), pThreadStack(nullptr), pCallback(callback), pCallbackArg(callbackArg) { //! save attribute assignment iAttributes = iAttr; @@ -39,7 +40,8 @@ public: //! create the thread if (pThread && pThreadStack) { OSCreateThread(pThread, &CThread::threadCallback, 1, (char *) this, pThreadStack + iStackSize, iStackSize, iPriority, iAttributes); - OSSetThreadName(pThread, "FTP Server Thread"); + pThreadName = threadName; + OSSetThreadName(pThread, pThreadName.c_str()); } } @@ -138,6 +140,7 @@ private: uint8_t *pThreadStack; Callback pCallback; void *pCallbackArg; + std::string pThreadName; }; #endif