< prev index next >

src/share/vm/runtime/thread.cpp

Print this page
rev 10311 : 8150619: Improve thread based logging introduced with 8149036
Reviewed-by:

@@ -1804,14 +1804,10 @@
     }
 
     // Call after last event on thread
     EVENT_THREAD_EXIT(this);
 
-    log_info(os, thread)("Thread " UINTX_FORMAT " %s.",
-      os::current_thread_id(),
-      exit_type == JavaThread::normal_exit ? "exiting" : "detaching");
-
     // Call Thread.exit(). We try 3 times in case we got another Thread.stop during
     // the execution of the method. If that is not enough, then we don't really care. Thread.stop
     // is deprecated anyhow.
     if (!is_Compiler_thread()) {
       int count = 3;

@@ -1930,10 +1926,14 @@
   if (UseG1GC) {
     flush_barrier_queues();
   }
 #endif // INCLUDE_ALL_GCS
 
+  log_info(os, thread)("JavaThread %s (tid: " UINTX_FORMAT ").",
+    exit_type == JavaThread::normal_exit ? "exiting" : "detaching",
+    os::current_thread_id());
+
   // Remove from list of active threads list, and notify VM thread if we are the last non-daemon thread
   Threads::remove(this);
 }
 
 #if INCLUDE_ALL_GCS
< prev index next >