From owner-svn-ports-all@freebsd.org Sun Mar 4 17:35:31 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B4DFF465B9; Sun, 4 Mar 2018 17:35:31 +0000 (UTC) (envelope-from glewis@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF24D84F1D; Sun, 4 Mar 2018 17:35:30 +0000 (UTC) (envelope-from glewis@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9C531879F; Sun, 4 Mar 2018 17:35:30 +0000 (UTC) (envelope-from glewis@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24HZUiu066782; Sun, 4 Mar 2018 17:35:30 GMT (envelope-from glewis@FreeBSD.org) Received: (from glewis@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24HZUKC066781; Sun, 4 Mar 2018 17:35:30 GMT (envelope-from glewis@FreeBSD.org) Message-Id: <201803041735.w24HZUKC066781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glewis set sender to glewis@FreeBSD.org using -f From: Greg Lewis Date: Sun, 4 Mar 2018 17:35:30 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r463588 - head/java/openjdk8/files X-SVN-Group: ports-head X-SVN-Commit-Author: glewis X-SVN-Commit-Paths: head/java/openjdk8/files X-SVN-Commit-Revision: 463588 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2018 17:35:31 -0000 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) {