Stop overwriting already-specified thread names.

This commit is contained in:
Ben Vanik 2015-07-26 23:49:32 -07:00
parent 7ecc6362de
commit 987589dcbc
1 changed files with 7 additions and 5 deletions

View File

@ -324,11 +324,13 @@ X_STATUS XThread::Create() {
} }
thread_->set_affinity_mask(proc_mask); thread_->set_affinity_mask(proc_mask);
// Set the thread name based on host ID (for easier debugging) // Set the thread name based on host ID (for easier debugging).
char thread_name[32]; if (name_.empty()) {
snprintf(thread_name, xe::countof(thread_name), "XThread%04X (%04X)", char thread_name[32];
handle(), thread_->id()); snprintf(thread_name, xe::countof(thread_name), "XThread%04X (%04X)",
set_name(thread_name); handle(), thread_->id());
set_name(thread_name);
}
if (creation_params_.creation_flags & 0x60) { if (creation_params_.creation_flags & 0x60) {
thread_->set_priority(creation_params_.creation_flags & 0x20 ? 1 : 0); thread_->set_priority(creation_params_.creation_flags & 0x20 ? 1 : 0);