8264372: Threads::destroy_vm only ever returns true

Reviewed-by: shade, dcubed
This commit is contained in:
David Holmes 2021-04-18 04:32:11 +00:00
parent 73d5f3b586
commit 1ac25b8201
3 changed files with 6 additions and 15 deletions

View file

@ -3731,17 +3731,10 @@ static jint JNICALL jni_DestroyJavaVM_inner(JavaVM *vm) {
MACOS_AARCH64_ONLY(WXMode oldmode = thread->enable_wx(WXWrite));
ThreadStateTransition::transition_from_native(thread, _thread_in_vm);
if (Threads::destroy_vm()) {
// Should not change thread state, VM is gone
vm_created = 0;
res = JNI_OK;
return res;
} else {
ThreadStateTransition::transition(thread, _thread_in_vm, _thread_in_native);
MACOS_AARCH64_ONLY(thread->enable_wx(oldmode));
res = JNI_ERR;
return res;
}
Threads::destroy_vm();
// Don't bother restoring thread state, VM is gone.
vm_created = 0;
return JNI_OK;
}
jint JNICALL jni_DestroyJavaVM(JavaVM *vm) {

View file

@ -3699,7 +3699,7 @@ void JavaThread::invoke_shutdown_hooks() {
// + Delete this thread
// + Return to caller
bool Threads::destroy_vm() {
void Threads::destroy_vm() {
JavaThread* thread = JavaThread::current();
#ifdef ASSERT
@ -3792,8 +3792,6 @@ bool Threads::destroy_vm() {
#endif
LogConfiguration::finalize();
return true;
}

View file

@ -1812,7 +1812,7 @@ class Threads: AllStatic {
static void create_vm_init_libraries();
static void create_vm_init_agents();
static void shutdown_vm_agents();
static bool destroy_vm();
static void destroy_vm();
// Supported VM versions via JNI
// Includes JNI_VERSION_1_1
static jboolean is_supported_jni_version_including_1_1(jint version);