changeset 4985:54995aa29dbb

. Promote the OSTHREAD type to a unit64_t. It is assigned a thread_id_it, which is typedef'ed as a pthread_t. On BSD that is a pointer to a pthread, so a 32 bit type won't cut it (for amd64 and other 64 bit architectures). . Add some related casts so that compilation succeeds. These feel hacky, but I haven't got a deeper fix for them yet.
author Greg Lewis <glewis@eyesbeyond.com>
date Wed, 04 Dec 2013 22:06:37 -0800
parents 533177323b2a
children 31e37170bcb2
files src/share/vm/gc_implementation/shared/gcTraceSend.cpp src/share/vm/runtime/objectMonitor.cpp src/share/vm/runtime/vmThread.cpp src/share/vm/trace/tracetypes.xml
diffstat 4 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shared/gcTraceSend.cpp	Wed Dec 04 21:59:22 2013 -0800
+++ b/src/share/vm/gc_implementation/shared/gcTraceSend.cpp	Wed Dec 04 22:06:37 2013 -0800
@@ -109,7 +109,7 @@
   if (e.should_commit()) {
     e.set_gcId(_shared_gc_info.id());
     e.set_data(to_trace_struct(pf_info));
-    e.set_thread(pf_info.thread()->thread_id());
+    e.set_thread((uint64_t) pf_info.thread()->thread_id());
     e.commit();
   }
 }
--- a/src/share/vm/runtime/objectMonitor.cpp	Wed Dec 04 21:59:22 2013 -0800
+++ b/src/share/vm/runtime/objectMonitor.cpp	Wed Dec 04 22:06:37 2013 -0800
@@ -1684,7 +1684,7 @@
      }
      iterator->_notified = 1 ;
      Thread * Self = THREAD;
-     iterator->_notifier_tid = Self->osthread()->thread_id();
+     iterator->_notifier_tid = (jlong) Self->osthread()->thread_id();
 
      ObjectWaiter * List = _EntryList ;
      if (List != NULL) {
@@ -1810,7 +1810,7 @@
      guarantee (iterator->_notified == 0, "invariant") ;
      iterator->_notified = 1 ;
      Thread * Self = THREAD;
-     iterator->_notifier_tid = Self->osthread()->thread_id();
+     iterator->_notifier_tid = (jlong) Self->osthread()->thread_id();
      if (Policy != 4) {
         iterator->TState = ObjectWaiter::TS_ENTER ;
      }
--- a/src/share/vm/runtime/vmThread.cpp	Wed Dec 04 21:59:22 2013 -0800
+++ b/src/share/vm/runtime/vmThread.cpp	Wed Dec 04 22:06:37 2013 -0800
@@ -390,7 +390,7 @@
       // Only write caller thread information for non-concurrent vm operations.
       // For concurrent vm operations, the thread id is set to 0 indicating thread is unknown.
       // This is because the caller thread could have exited already.
-      event.set_caller(is_concurrent ? 0 : op->calling_thread()->osthread()->thread_id());
+      event.set_caller(is_concurrent ? 0 : (uint64_t) op->calling_thread()->osthread()->thread_id());
       event.commit();
     }
 
--- a/src/share/vm/trace/tracetypes.xml	Wed Dec 04 21:59:22 2013 -0800
+++ b/src/share/vm/trace/tracetypes.xml	Wed Dec 04 22:06:37 2013 -0800
@@ -60,7 +60,7 @@
  <types>
   <content_types>
     <content_type id="Thread" hr_name="Thread"
-                  type="U4" builtin_type="OSTHREAD">
+                  type="thread_id_t" builtin_type="OSTHREAD">
       <value type="UTF8" field="name" label="Thread name"/>
     </content_type>
 
@@ -294,8 +294,8 @@
                   type="u8" sizeop="sizeof(u8)"/>
 
     <!-- OS Thread ID -->
-    <primary_type symbol="OSTHREAD" datatype="U4" contenttype="OSTHREAD"
-                  type="u4" sizeop="sizeof(u4)"/>
+    <primary_type symbol="OSTHREAD" datatype="U8" contenttype="OSTHREAD"
+                  type="u8" sizeop="sizeof(u8)"/>
 
     <!-- VM Thread ID Note: changed from U2 to U8 for hotspot -->
     <primary_type symbol="VMTHREAD" datatype="U8" contenttype="VMTHREAD"