8057744: (process) Synchronize exiting of threads and process [win]

Reviewed-by: dholmes, dcubed, sla
This commit is contained in:
Ivan Gerasimov 2014-09-10 09:52:41 -07:00
parent 3ad47cdbeb
commit 497f5c44a6
9 changed files with 112 additions and 30 deletions

View file

@ -430,8 +430,6 @@ extern "C" {
}
}
jint volatile vm_getting_terminated = 0;
// Note: before_exit() can be executed only once, if more than one threads
// are trying to shutdown the VM at the same time, only one thread
// can run before_exit() and all other threads must wait.
@ -462,8 +460,6 @@ void before_exit(JavaThread * thread) {
}
}
OrderAccess::release_store(&vm_getting_terminated, 1);
// The only difference between this and Win32's _onexit procs is that
// this version is invoked before any threads get killed.
ExitProc* current = exit_procs;
@ -587,7 +583,7 @@ void notify_vm_shutdown() {
void vm_direct_exit(int code) {
notify_vm_shutdown();
os::wait_for_keypress_at_exit();
::exit(code);
os::exit(code);
}
void vm_perform_shutdown_actions() {