diff --git a/src/hotspot/share/runtime/java.cpp b/src/hotspot/share/runtime/java.cpp index de3d12c3883..d78e35c4e68 100644 --- a/src/hotspot/share/runtime/java.cpp +++ b/src/hotspot/share/runtime/java.cpp @@ -78,6 +78,7 @@ #include "runtime/vm_version.hpp" #include "sanitizers/leak.hpp" #include "utilities/dtrace.hpp" +#include "utilities/events.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" #include "utilities/vmError.hpp" @@ -366,6 +367,8 @@ void before_exit(JavaThread* thread, bool halt) { #define BEFORE_EXIT_DONE 2 static jint volatile _before_exit_status = BEFORE_EXIT_NOT_RUN; + Events::log(thread, "Before exit entered"); + // Note: don't use a Mutex to guard the entire before_exit(), as // JVMTI post_thread_end_event and post_vm_death_event will run native code. // A CAS or OSMutex would work just fine but then we need to manipulate diff --git a/src/hotspot/share/runtime/threads.cpp b/src/hotspot/share/runtime/threads.cpp index e3bb67bfee5..b92e5a90c55 100644 --- a/src/hotspot/share/runtime/threads.cpp +++ b/src/hotspot/share/runtime/threads.cpp @@ -833,10 +833,10 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { // Threads::destroy_vm() is normally called from jni_DestroyJavaVM() when // the program falls off the end of main(). Another VM exit path is through -// vm_exit() when the program calls System.exit() to return a value or when -// there is a serious error in VM. The two shutdown paths are not exactly -// the same, but they share Shutdown.shutdown() at Java level and before_exit() -// and VM_Exit op at VM level. +// vm_exit(), when the program calls System.exit() to return a value, or when +// there is a serious error in VM. +// These two separate shutdown paths are not exactly the same, but they share +// Shutdown.shutdown() at Java level and before_exit() and VM_Exit op at VM level. // // Shutdown sequence: // + Shutdown native memory tracking if it is on