changeset 32070:8f5a14b884e2

6661889: thread id on Linux is inconsistent in error and log outputs Reviewed-by: dholmes, kvn
author jmanson
date Wed, 29 Jul 2015 22:59:03 -0400
parents aa4049b4184a
children 90ad2be7c11c bc13add2c295
files hotspot/src/os/linux/vm/os_linux.cpp
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Mon Jul 27 13:56:26 2015 -0700
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Wed Jul 29 22:59:03 2015 -0400
@@ -653,8 +653,7 @@
   OSThread* osthread = thread->osthread();
   Monitor* sync = osthread->startThread_lock();
 
-  // thread_id is kernel thread id (similar to Solaris LWP id)
-  osthread->set_thread_id(os::Linux::gettid());
+  osthread->set_thread_id(os::current_thread_id());
 
   if (UseNUMA) {
     int lgrp_id = os::numa_get_group_id();
@@ -1424,7 +1423,8 @@
   return n;
 }
 
-intx os::current_thread_id() { return (intx)pthread_self(); }
+// thread_id is kernel thread id (similar to Solaris LWP id)
+intx os::current_thread_id() { return os::Linux::gettid(); }
 int os::current_process_id() {
   return ::getpid();
 }