aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGiel van Schijndel <me@mortis.eu>2012-06-30 17:23:04 +0200
committerGiel van Schijndel <me@mortis.eu>2012-07-17 01:50:35 +0200
commit304ca955082a709a455cf0ba14ae9b995f92925e (patch)
treefd0b03292ff618a66f11d18aebc8ee051f8a8d4a /src
parent9f46ab62b1ba47ad594d5e06e4fe837297f4790e (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/util.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 56755a25bc..498fb074d0 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;