fix(linux/freebsd): truncate thread names to 15 characters (#5527)

This commit is contained in:
Conn O'Griofa authored and GitHub committed 2026-08-19 23:31:03 -04:00
1 parent 6ad5f9735d
commit 9e1f089e1f
4 files changed
+10 -7

No files matched your search

+4 -2
View File
@@ -521,8 +521,10 @@ namespace platf {
}
}
void set_thread_name(const std::string &name) {
pthread_setname_np(pthread_self(), name.c_str());
void set_thread_name(std::string_view name) {
// Truncate name to fit in Linux/FreeBSD kernel's 16 byte limit
std::string tr_name {name.substr(0, 15)};
pthread_setname_np(pthread_self(), tr_name.c_str());
}
/**