Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/mp/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ std::string ThreadName(const char* exe_name)
#endif // HAVE_PTHREAD_GETNAME_NP

std::ostringstream buffer;
buffer << (exe_name ? exe_name : "") << "-" << getpid() << "/" << thread_name << "-";
buffer << (exe_name ? exe_name : "") << "-" << getpid() << "/";

if (thread_name[0] != '\0') {
buffer << thread_name << "-";
}

// Prefer platform specific thread ids over the standard C++11 ones because
// the former are shorter and are the same as what gdb prints "LWP ...".
Expand Down