src/share/vm/runtime/java.cpp

Print this page

        

*** 439,448 **** --- 439,450 ---- exit_procs = entry; } } } + int 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. void before_exit(JavaThread * thread) { #define BEFORE_EXIT_NOT_RUN 0
*** 469,478 **** --- 471,482 ---- case BEFORE_EXIT_DONE: return; } } + 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; while (current != NULL) { ExitProc* next = current->next();