mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-10 00:43:59 +02:00
Added changing thread name for FreeBSD
This commit is contained in:
parent
55d7e31f7e
commit
62c2be160a
@ -107,10 +107,14 @@ void setThreadName(const std::string &name)
|
|||||||
|
|
||||||
#elif defined(VCMI_APPLE)
|
#elif defined(VCMI_APPLE)
|
||||||
pthread_setname_np(name.c_str());
|
pthread_setname_np(name.c_str());
|
||||||
|
#elif defined(VCMI_FREEBSD)
|
||||||
|
pthread_setname_np(pthread_self(), name.c_str());
|
||||||
#elif defined(VCMI_HAIKU)
|
#elif defined(VCMI_HAIKU)
|
||||||
rename_thread(find_thread(NULL), name.c_str());
|
rename_thread(find_thread(NULL), name.c_str());
|
||||||
#elif defined(VCMI_UNIX)
|
#elif defined(VCMI_UNIX)
|
||||||
prctl(PR_SET_NAME, name.c_str(), 0, 0, 0);
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user