hotspot/src/share/vm/runtime/java.cpp
changeset 39274 940f0e8e9ec2
parent 37248 11a660dbbb8e
child 42650 1f304d0c888b
--- a/hotspot/src/share/vm/runtime/java.cpp	Mon Jun 13 10:10:35 2016 +0200
+++ b/hotspot/src/share/vm/runtime/java.cpp	Mon Jun 13 11:48:11 2016 +0200
@@ -446,6 +446,14 @@
     os::infinite_sleep();
   }
 
+  EventThreadEnd event;
+  if (event.should_commit()) {
+    event.set_thread(THREAD_TRACE_ID(thread));
+    event.commit();
+  }
+
+  TRACE_VM_EXIT();
+
   // Stop the WatcherThread. We do this before disenrolling various
   // PeriodicTasks to reduce the likelihood of races.
   if (PeriodicTask::num_tasks() > 0) {
@@ -484,13 +492,6 @@
     JvmtiExport::post_thread_end(thread);
   }
 
-
-  EventThreadEnd event;
-  if (event.should_commit()) {
-      event.set_thread(THREAD_TRACE_ID(thread));
-      event.commit();
-  }
-
   // Always call even when there are not JVMTI environments yet, since environments
   // may be attached late and JVMTI must track phases of VM execution
   JvmtiExport::post_vm_death();