[Kernel] XThread: Added mutex to set_name.

There is a small chance that game will spam requests for thread name change which will cause invalid free
This commit is contained in:
Gliniak
2026-01-31 18:32:52 +01:00
parent 78d700af41
commit 7e1506ff23
2 changed files with 3 additions and 0 deletions

View File

@@ -136,6 +136,7 @@ void XThread::set_last_error(uint32_t error_code) {
}
void XThread::set_name(const std::string_view name) {
std::lock_guard<std::mutex> lock(thread_lock_);
thread_name_ = fmt::format("{} ({:08X})", name, handle());
if (thread_) {

View File

@@ -465,6 +465,8 @@ class XThread : public XObject, public cpu::Thread {
bool running_ = false;
int32_t priority_ = 0;
std::mutex thread_lock_;
};
class XHostThread : public XThread {