Update thread names (#1120)

This commit is contained in:
goeiecool9999 2024-03-15 23:06:48 +01:00 committed by GitHub
parent 731713de3a
commit eaa82817dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 29 additions and 12 deletions

View file

@ -155,7 +155,9 @@ void SetThreadName(const char* name)
#elif BOOST_OS_MACOS
pthread_setname_np(name);
#else
pthread_setname_np(pthread_self(), name);
if(std::strlen(name) > 15)
cemuLog_log(LogType::Force, "Truncating thread name {} because it was longer than 15 characters", name);
pthread_setname_np(pthread_self(), std::string{name}.substr(0,15).c_str());
#endif
}