Browse Source

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>
0.8
Giel van Schijndel 13 years ago
parent
commit
304ca95508
  1. 5
      src/util.cpp

5
src/util.cpp

@ -1282,6 +1282,11 @@ void RenameThread(const char* name)
#if defined(__linux__) && defined(PR_SET_NAME) #if defined(__linux__) && defined(PR_SET_NAME)
// Only the first 15 characters are used (16 - NUL terminator) // Only the first 15 characters are used (16 - NUL terminator)
::prctl(PR_SET_NAME, name, 0, 0, 0); ::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 #else
// Prevent warnings for unused parameters... // Prevent warnings for unused parameters...
(void)name; (void)name;

Loading…
Cancel
Save