equal
deleted
inserted
replaced
428 exit_procs = entry; |
428 exit_procs = entry; |
429 } |
429 } |
430 } |
430 } |
431 } |
431 } |
432 |
432 |
|
433 jint volatile vm_getting_terminated = 0; |
|
434 |
433 // Note: before_exit() can be executed only once, if more than one threads |
435 // Note: before_exit() can be executed only once, if more than one threads |
434 // are trying to shutdown the VM at the same time, only one thread |
436 // are trying to shutdown the VM at the same time, only one thread |
435 // can run before_exit() and all other threads must wait. |
437 // can run before_exit() and all other threads must wait. |
436 void before_exit(JavaThread * thread) { |
438 void before_exit(JavaThread * thread) { |
437 #define BEFORE_EXIT_NOT_RUN 0 |
439 #define BEFORE_EXIT_NOT_RUN 0 |
458 case BEFORE_EXIT_DONE: |
460 case BEFORE_EXIT_DONE: |
459 return; |
461 return; |
460 } |
462 } |
461 } |
463 } |
462 |
464 |
|
465 OrderAccess::release_store(&vm_getting_terminated, 1); |
|
466 |
463 // The only difference between this and Win32's _onexit procs is that |
467 // The only difference between this and Win32's _onexit procs is that |
464 // this version is invoked before any threads get killed. |
468 // this version is invoked before any threads get killed. |
465 ExitProc* current = exit_procs; |
469 ExitProc* current = exit_procs; |
466 while (current != NULL) { |
470 while (current != NULL) { |
467 ExitProc* next = current->next(); |
471 ExitProc* next = current->next(); |