From 62c2be160a66c84f7c9ba2b772769877c447d7b7 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Sun, 12 May 2024 15:10:29 +0000 Subject: [PATCH] Added changing thread name for FreeBSD --- lib/CThreadHelper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/CThreadHelper.cpp b/lib/CThreadHelper.cpp index 21f8dc4bb..f7113e58c 100644 --- a/lib/CThreadHelper.cpp +++ b/lib/CThreadHelper.cpp @@ -107,10 +107,14 @@ void setThreadName(const std::string &name) #elif defined(VCMI_APPLE) pthread_setname_np(name.c_str()); +#elif defined(VCMI_FREEBSD) + pthread_setname_np(pthread_self(), name.c_str()); #elif defined(VCMI_HAIKU) rename_thread(find_thread(NULL), name.c_str()); #elif defined(VCMI_UNIX) prctl(PR_SET_NAME, name.c_str(), 0, 0, 0); +#else + #error "Failed to find method to set thread name on this system. Please provide one (or disable this line if you just want code to compile)" #endif }