8055338: (process) Add instrumentation to help diagnose JDK-6573254

Reviewed-by: dcubed, ohair, iklam, dholmes, sspitsyn, sla
This commit is contained in:
Ivan Gerasimov 2014-08-21 16:32:36 -07:00
parent 6515584f58
commit 8d7b009834
2 changed files with 20 additions and 1 deletions

View file

@ -430,6 +430,8 @@ 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.
@ -460,6 +462,8 @@ 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;