XThread::set_name - Use more efficient xe::format_string instead of a StringBuffer
This commit is contained in:
parent
e4e1bc1060
commit
e54850e1f2
|
@ -137,15 +137,12 @@ void XThread::set_last_error(uint32_t error_code) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void XThread::set_name(const std::string& name) {
|
void XThread::set_name(const std::string& name) {
|
||||||
StringBuffer buff;
|
name_ = xe::format_string("%s (%.8X)", name, handle());
|
||||||
buff.Append(name);
|
|
||||||
buff.AppendFormat(" (%.8X)", handle());
|
|
||||||
|
|
||||||
name_ = buff.ToString();
|
|
||||||
if (thread_) {
|
if (thread_) {
|
||||||
// May be getting set before the thread is created.
|
// May be getting set before the thread is created.
|
||||||
// One the thread is ready it will handle it.
|
// One the thread is ready it will handle it.
|
||||||
thread_->set_name(buff.ToString());
|
thread_->set_name(name_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue