< prev index next >

src/hotspot/share/runtime/thread.cpp

Print this page

        

@@ -4210,14 +4210,14 @@
 //   + Stop VM thread, it will bring the remaining VM to a safepoint and stop
 //     the compiler threads at safepoint
 //     <-- do not use anything that could get blocked by Safepoint -->
 //   + Disable tracing at JNI/JVM barriers
 //   + Set _vm_exited flag for threads that are still running native code
-//   + Delete this thread
 //   + Call exit_globals()
 //      > deletes tty
 //      > deletes PerfMemory resources
+//   + Delete this thread
 //   + Return to caller
 
 bool Threads::destroy_vm() {
   JavaThread* thread = JavaThread::current();
 

@@ -4289,10 +4289,13 @@
   IdealGraphPrinter::clean_up();
 #endif
 
   notify_vm_shutdown();
 
+  // exit_globals() will delete tty
+  exit_globals();
+
   // We are after VM_Exit::set_vm_exited() so we can't call
   // thread->smr_delete() or we will block on the Threads_lock.
   // Deleting the shutdown thread here is safe because another
   // JavaThread cannot have an active ThreadsListHandle for
   // this JavaThread.

@@ -4302,13 +4305,10 @@
   if (JVMCICounterSize > 0) {
     FREE_C_HEAP_ARRAY(jlong, JavaThread::_jvmci_old_thread_counters);
   }
 #endif
 
-  // exit_globals() will delete tty
-  exit_globals();
-
   LogConfiguration::finalize();
 
   return true;
 }
 
< prev index next >