From 304ca955082a709a455cf0ba14ae9b995f92925e Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Sat, 30 Jun 2012 17:23:04 +0200 Subject: [PATCH] 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 --- src/util.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util.cpp b/src/util.cpp index 56755a25b..498fb074d 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -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;