File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,29 @@ static void beforeHalt() {
62
62
private static void logRuntimeExit (int status ) {
63
63
// Disable exit logging (GR-45418/JDK-8301627)
64
64
}
65
+
66
+ @ Alias
67
+ static native void runHooks ();
68
+
69
+ @ Alias
70
+ static native void halt (int status );
71
+
72
+ /**
73
+ * This substitution makes a few modifications to {@code Shutdown#exit}:
74
+ * <ul>
75
+ * <li>it omits {@code logRuntimeExit} (exit logging is disabled: GR-45418/JDK-8301627).</li>
76
+ * <li>it omits {@code beforeHalt} (not implemented).</li>
77
+ * <li>it runs teardown hooks after running shutdown hooks and before halting.</li>
78
+ * </ul>
79
+ */
80
+ @ Substitute
81
+ static void exit (int status ) {
82
+ synchronized (Target_java_lang_Shutdown .class ) {
83
+ runHooks ();
84
+ RuntimeSupport .executeTearDownHooks ();
85
+ halt (status );
86
+ }
87
+ }
65
88
}
66
89
67
90
/** Utility methods for Target_java_lang_Shutdown. */
You can’t perform that action at this time.
0 commit comments