mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 01:24:33 +02:00
8264372: Threads::destroy_vm only ever returns true
Reviewed-by: shade, dcubed
This commit is contained in:
parent
73d5f3b586
commit
1ac25b8201
3 changed files with 6 additions and 15 deletions
|
@ -3731,17 +3731,10 @@ static jint JNICALL jni_DestroyJavaVM_inner(JavaVM *vm) {
|
||||||
MACOS_AARCH64_ONLY(WXMode oldmode = thread->enable_wx(WXWrite));
|
MACOS_AARCH64_ONLY(WXMode oldmode = thread->enable_wx(WXWrite));
|
||||||
|
|
||||||
ThreadStateTransition::transition_from_native(thread, _thread_in_vm);
|
ThreadStateTransition::transition_from_native(thread, _thread_in_vm);
|
||||||
if (Threads::destroy_vm()) {
|
Threads::destroy_vm();
|
||||||
// Should not change thread state, VM is gone
|
// Don't bother restoring thread state, VM is gone.
|
||||||
vm_created = 0;
|
vm_created = 0;
|
||||||
res = JNI_OK;
|
return 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
jint JNICALL jni_DestroyJavaVM(JavaVM *vm) {
|
jint JNICALL jni_DestroyJavaVM(JavaVM *vm) {
|
||||||
|
|
|
@ -3699,7 +3699,7 @@ void JavaThread::invoke_shutdown_hooks() {
|
||||||
// + Delete this thread
|
// + Delete this thread
|
||||||
// + Return to caller
|
// + Return to caller
|
||||||
|
|
||||||
bool Threads::destroy_vm() {
|
void Threads::destroy_vm() {
|
||||||
JavaThread* thread = JavaThread::current();
|
JavaThread* thread = JavaThread::current();
|
||||||
|
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
|
@ -3792,8 +3792,6 @@ bool Threads::destroy_vm() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LogConfiguration::finalize();
|
LogConfiguration::finalize();
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1812,7 +1812,7 @@ class Threads: AllStatic {
|
||||||
static void create_vm_init_libraries();
|
static void create_vm_init_libraries();
|
||||||
static void create_vm_init_agents();
|
static void create_vm_init_agents();
|
||||||
static void shutdown_vm_agents();
|
static void shutdown_vm_agents();
|
||||||
static bool destroy_vm();
|
static void destroy_vm();
|
||||||
// Supported VM versions via JNI
|
// Supported VM versions via JNI
|
||||||
// Includes JNI_VERSION_1_1
|
// Includes JNI_VERSION_1_1
|
||||||
static jboolean is_supported_jni_version_including_1_1(jint version);
|
static jboolean is_supported_jni_version_including_1_1(jint version);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue