This commit is contained in:
Jesper Wilhelmsson 2018-03-01 01:47:46 +01:00
commit 3dfe4d61b3
176 changed files with 3416 additions and 2177 deletions

View file

@ -275,6 +275,7 @@ public class Runtime {
if (sm != null) {
sm.checkExit(status);
}
Shutdown.beforeHalt();
Shutdown.halt(status);
}

View file

@ -140,6 +140,9 @@ class Shutdown {
VM.shutdown();
}
/* Notify the VM that it's time to halt. */
static native void beforeHalt();
/* The halt method is synchronized on the halt lock
* to avoid corruption of the delete-on-shutdown file list.
* It invokes the true native halt method.
@ -167,6 +170,7 @@ class Shutdown {
/* Synchronize on the class object, causing any other thread
* that attempts to initiate shutdown to stall indefinitely
*/
beforeHalt();
runHooks();
halt(status);
}

View file

@ -29,6 +29,11 @@
#include "java_lang_Shutdown.h"
JNIEXPORT void JNICALL
Java_java_lang_Shutdown_beforeHalt(JNIEnv *env, jclass ignored)
{
JVM_BeforeHalt();
}
JNIEXPORT void JNICALL
Java_java_lang_Shutdown_halt0(JNIEnv *env, jclass ignored, jint code)