Skip to content

Commit

Permalink
Merge pull request #17439 from eclipse-openj9/revert-17417-jvm_init_s…
Browse files Browse the repository at this point in the history
…hutdown_sync_039

Revert "(0.39) Sync JVM init and exit paths"
  • Loading branch information
tajila committed May 19, 2023
2 parents 8b5fd99 + 9336240 commit a10e6b9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
11 changes: 0 additions & 11 deletions runtime/vm/jniinv.c
Expand Up @@ -160,10 +160,7 @@ jint JNICALL J9_CreateJavaVM(JavaVM ** p_vm, void ** p_env, J9CreateJavaVMParams
env = vm->mainThread;

/* Success */
omrthread_monitor_enter(vm->runtimeFlagsMutex);
vm->runtimeFlags |= J9_RUNTIME_INITIALIZED;
omrthread_monitor_notify_all(vm->runtimeFlagsMutex);
omrthread_monitor_exit(vm->runtimeFlagsMutex);
*p_env = (void*) env;

/* Link the VM into the list */
Expand Down Expand Up @@ -349,14 +346,6 @@ protectedDestroyJavaVM(J9PortLibrary* portLibrary, void * userData)
*/
return JNI_ERR;
}
/* Wait until the JVM has initialized before exiting the JVM. */
while (OMR_ARE_NO_BITS_SET(vm->runtimeFlags, J9_RUNTIME_INITIALIZED)) {
if (vm->runtimeFlagsMutex != NULL) {
omrthread_monitor_wait(vm->runtimeFlagsMutex);
} else {
omrthread_yield();
}
}
if (vm->runtimeFlagsMutex != NULL) {
omrthread_monitor_exit(vm->runtimeFlagsMutex);
}
Expand Down
8 changes: 0 additions & 8 deletions runtime/vm/jvminit.c
Expand Up @@ -536,14 +536,6 @@ exitJavaVM(J9VMThread * vmThread, IDATA rc)
}

vm->runtimeFlags |= J9_RUNTIME_EXIT_STARTED;
/* Wait until the JVM has initialized before exiting the JVM. */
while (OMR_ARE_NO_BITS_SET(vm->runtimeFlags, J9_RUNTIME_INITIALIZED)) {
if (vm->runtimeFlagsMutex != NULL) {
omrthread_monitor_wait(vm->runtimeFlagsMutex);
} else {
omrthread_yield();
}
}
if(vm->runtimeFlagsMutex != NULL) {
omrthread_monitor_exit(vm->runtimeFlagsMutex);
}
Expand Down

0 comments on commit a10e6b9

Please sign in to comment.