aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorglewis <glewis@FreeBSD.org>2018-03-05 01:35:30 +0800
committerglewis <glewis@FreeBSD.org>2018-03-05 01:35:30 +0800
commit698d3412c37b1783cc4fb46f4db7ed7c4ed4b2ce (patch)
tree0098e170b40586c28a1b828006bdd2ad85bbe19f /java
parent6155560c6d98bf3e007ae06f7378f183bbe64454 (diff)
downloadfreebsd-ports-graphics-698d3412c37b1783cc4fb46f4db7ed7c4ed4b2ce.tar.gz
freebsd-ports-graphics-698d3412c37b1783cc4fb46f4db7ed7c4ed4b2ce.tar.zst
freebsd-ports-graphics-698d3412c37b1783cc4fb46f4db7ed7c4ed4b2ce.zip
. Allow thread names to be set on FreeBSD.
PR: 223589 Submitted by: bra@fsn.hu
Diffstat (limited to 'java')
-rw-r--r--java/openjdk8/files/patch-hotspot_src_os_bsd_vm_os__bsd.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/java/openjdk8/files/patch-hotspot_src_os_bsd_vm_os__bsd.cpp b/java/openjdk8/files/patch-hotspot_src_os_bsd_vm_os__bsd.cpp
index 7991f1265b8..edafe166630 100644
--- a/java/openjdk8/files/patch-hotspot_src_os_bsd_vm_os__bsd.cpp
+++ b/java/openjdk8/files/patch-hotspot_src_os_bsd_vm_os__bsd.cpp
@@ -224,3 +224,26 @@
if (addr == requested_addr) {
return requested_addr;
}
+@@ -4010,15 +4010,19 @@
+ }
+
+ void os::set_native_thread_name(const char *name) {
+-#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5
+- // This is only supported in Snow Leopard and beyond
+ if (name != NULL) {
++#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5
++ // This is only supported in Snow Leopard and beyond
+ // Add a "Java: " prefix to the name
+ char buf[MAXTHREADNAMESIZE];
+ snprintf(buf, sizeof(buf), "Java: %s", name);
+ pthread_setname_np(buf);
+- }
++#elif defined(__FreeBSD__)
++ char buf[MAXCOMLEN+1];
++ strlcpy(buf, name, sizeof(buf));
++ pthread_set_name_np(pthread_self(), buf);
+ #endif
++ }
+ }
+
+ bool os::distribute_processes(uint length, uint* distribution) {