Add support for renaming FreeBSD and OpenBSD threads

NOTE: This is currently disabled, until a developer with FreeBSD/OpenBSD
      can confirm that this works (without causing undefined behaviour
      preferrably).

Signed-off-by: Giel van Schijndel <me@mortis.eu>
This commit is contained in:
Giel van Schijndel 2012-06-30 17:23:04 +02:00
parent 9f46ab62b1
commit 304ca95508

View File

@ -1282,6 +1282,11 @@ void RenameThread(const char* name)
#if defined(__linux__) && defined(PR_SET_NAME)
// Only the first 15 characters are used (16 - NUL terminator)
::prctl(PR_SET_NAME, name, 0, 0, 0);
#elif 0 && (defined(__FreeBSD__) || defined(__OpenBSD__))
// TODO: This is currently disabled because it needs to be verified to work
// on FreeBSD or OpenBSD first. When verified the '0 &&' part can be
// removed.
pthread_set_name_np(pthread_self(), name);
#else
// Prevent warnings for unused parameters...
(void)name;