mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-12-01 17:41:12 +00:00
fix(linux/freebsd): truncate thread names to 15 characters (#5527)
This commit is contained in:
1 parent
6ad5f9735d
commit
9e1f089e1f
4 files changed
+10
-7
No files matched your search
@@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user