Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Mar 2018 17:35:30 +0000 (UTC)
From:      Greg Lewis <glewis@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r463588 - head/java/openjdk8/files
Message-ID:  <201803041735.w24HZUKC066781@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glewis
Date: Sun Mar  4 17:35:30 2018
New Revision: 463588
URL: https://svnweb.freebsd.org/changeset/ports/463588

Log:
  . Allow thread names to be set on FreeBSD.
  
  PR:		223589
  Submitted by:	bra@fsn.hu

Modified:
  head/java/openjdk8/files/patch-hotspot_src_os_bsd_vm_os__bsd.cpp

Modified: head/java/openjdk8/files/patch-hotspot_src_os_bsd_vm_os__bsd.cpp
==============================================================================
--- head/java/openjdk8/files/patch-hotspot_src_os_bsd_vm_os__bsd.cpp	Sun Mar  4 16:58:30 2018	(r463587)
+++ head/java/openjdk8/files/patch-hotspot_src_os_bsd_vm_os__bsd.cpp	Sun Mar  4 17:35:30 2018	(r463588)
@@ -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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803041735.w24HZUKC066781>