summaryrefslogtreecommitdiff
path: root/openjdkjvm/OpenjdkJvm.cc
diff options
context:
space:
mode:
Diffstat (limited to 'openjdkjvm/OpenjdkJvm.cc')
-rw-r--r--openjdkjvm/OpenjdkJvm.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/openjdkjvm/OpenjdkJvm.cc b/openjdkjvm/OpenjdkJvm.cc
index 675a401bb6..18078abdad 100644
--- a/openjdkjvm/OpenjdkJvm.cc
+++ b/openjdkjvm/OpenjdkJvm.cc
@@ -35,6 +35,7 @@
#include <dlfcn.h>
#include <limits.h>
#include <stdio.h>
+#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/time.h>
@@ -314,8 +315,10 @@ JNIEXPORT __attribute__((noreturn)) void JVM_Exit(jint status) {
LOG(INFO) << "System.exit called, status: " << status;
art::Runtime::Current()->CallExitHook(status);
// Unsafe to call exit() while threads may still be running. They would race
- // with static destructors.
- _exit(status);
+ // with static destructors. However, have functions registered with
+ // `at_quick_exit` (for instance LLVM's code coverage profile dumping routine)
+ // be called before exiting.
+ quick_exit(status);
}
JNIEXPORT jstring JVM_NativeLoad(JNIEnv* env,