Mercurial > hg > openjdk > jdk8u > hotspot
changeset 9149:f066260954ae
8041626: Shutdown tracing event
Reviewed-by: dholmes, alanb, rriggs
author | rwestberg |
---|---|
date | Tue, 13 Feb 2018 15:48:23 +0100 |
parents | 161ab90e3cae |
children | 5a83b7215107 |
files | make/aix/makefiles/mapfile-vers-debug make/aix/makefiles/mapfile-vers-product make/bsd/makefiles/mapfile-vers-debug make/bsd/makefiles/mapfile-vers-product make/linux/makefiles/mapfile-vers-debug make/linux/makefiles/mapfile-vers-product make/solaris/makefiles/mapfile-vers src/share/vm/prims/jvm.cpp src/share/vm/prims/jvm.h src/share/vm/runtime/thread.cpp |
diffstat | 10 files changed, 26 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/make/aix/makefiles/mapfile-vers-debug Mon Aug 26 16:37:09 2019 -0300 +++ b/make/aix/makefiles/mapfile-vers-debug Tue Feb 13 15:48:23 2018 +0100 @@ -39,6 +39,7 @@ JVM_ArrayCopy; JVM_AssertionStatusDirectives; JVM_Available; + JVM_BeforeHalt; JVM_Bind; JVM_ClassDepth; JVM_ClassLoaderDepth;
--- a/make/aix/makefiles/mapfile-vers-product Mon Aug 26 16:37:09 2019 -0300 +++ b/make/aix/makefiles/mapfile-vers-product Tue Feb 13 15:48:23 2018 +0100 @@ -39,6 +39,7 @@ JVM_ArrayCopy; JVM_AssertionStatusDirectives; JVM_Available; + JVM_BeforeHalt; JVM_Bind; JVM_ClassDepth; JVM_ClassLoaderDepth;
--- a/make/bsd/makefiles/mapfile-vers-debug Mon Aug 26 16:37:09 2019 -0300 +++ b/make/bsd/makefiles/mapfile-vers-debug Tue Feb 13 15:48:23 2018 +0100 @@ -37,6 +37,7 @@ _JVM_ArrayCopy _JVM_AssertionStatusDirectives _JVM_Available + _JVM_BeforeHalt _JVM_Bind _JVM_ClassDepth _JVM_ClassLoaderDepth
--- a/make/bsd/makefiles/mapfile-vers-product Mon Aug 26 16:37:09 2019 -0300 +++ b/make/bsd/makefiles/mapfile-vers-product Tue Feb 13 15:48:23 2018 +0100 @@ -37,6 +37,7 @@ _JVM_ArrayCopy _JVM_AssertionStatusDirectives _JVM_Available + _JVM_BeforeHalt _JVM_Bind _JVM_ClassDepth _JVM_ClassLoaderDepth
--- a/make/linux/makefiles/mapfile-vers-debug Mon Aug 26 16:37:09 2019 -0300 +++ b/make/linux/makefiles/mapfile-vers-debug Tue Feb 13 15:48:23 2018 +0100 @@ -39,6 +39,7 @@ JVM_ArrayCopy; JVM_AssertionStatusDirectives; JVM_Available; + JVM_BeforeHalt; JVM_Bind; JVM_ClassDepth; JVM_ClassLoaderDepth;
--- a/make/linux/makefiles/mapfile-vers-product Mon Aug 26 16:37:09 2019 -0300 +++ b/make/linux/makefiles/mapfile-vers-product Tue Feb 13 15:48:23 2018 +0100 @@ -39,6 +39,7 @@ JVM_ArrayCopy; JVM_AssertionStatusDirectives; JVM_Available; + JVM_BeforeHalt; JVM_Bind; JVM_ClassDepth; JVM_ClassLoaderDepth;
--- a/make/solaris/makefiles/mapfile-vers Mon Aug 26 16:37:09 2019 -0300 +++ b/make/solaris/makefiles/mapfile-vers Tue Feb 13 15:48:23 2018 +0100 @@ -39,6 +39,7 @@ JVM_ArrayCopy; JVM_AssertionStatusDirectives; JVM_Available; + JVM_BeforeHalt; JVM_Bind; JVM_ClassDepth; JVM_ClassLoaderDepth;
--- a/src/share/vm/prims/jvm.cpp Mon Aug 26 16:37:09 2019 -0300 +++ b/src/share/vm/prims/jvm.cpp Tue Feb 13 15:48:23 2018 +0100 @@ -443,6 +443,16 @@ JVM_END +JVM_ENTRY_NO_ENV(void, JVM_BeforeHalt()) + JVMWrapper("JVM_BeforeHalt"); + EventShutdown event; + if (event.should_commit()) { + event.set_reason("Shutdown requested from Java"); + event.commit(); + } +JVM_END + + JVM_ENTRY_NO_ENV(void, JVM_Halt(jint code)) before_exit(thread); vm_exit(code);
--- a/src/share/vm/prims/jvm.h Mon Aug 26 16:37:09 2019 -0300 +++ b/src/share/vm/prims/jvm.h Tue Feb 13 15:48:23 2018 +0100 @@ -159,6 +159,9 @@ JVM_Exit(jint code); JNIEXPORT void JNICALL +JVM_BeforeHalt(); + +JNIEXPORT void JNICALL JVM_Halt(jint code); JNIEXPORT void JNICALL
--- a/src/share/vm/runtime/thread.cpp Mon Aug 26 16:37:09 2019 -0300 +++ b/src/share/vm/runtime/thread.cpp Tue Feb 13 15:48:23 2018 +0100 @@ -4012,6 +4012,12 @@ Mutex::_as_suspend_equivalent_flag); } + EventShutdown e; + if (e.should_commit()) { + e.set_reason("No remaining non-daemon Java threads"); + e.commit(); + } + // Hang forever on exit if we are reporting an error. if (ShowMessageBoxOnError && is_error_reported()) { os::infinite_sleep();