Example #1
0
void vm_perform_shutdown_actions() {
  // Warning: do not call 'exit_globals()' here. All threads are still running.
  // Calling 'exit_globals()' will disable thread-local-storage and cause all
  // kinds of assertions to trigger in debug mode.
  if (is_init_completed()) {
    Thread* thread = Thread::current();
    if (thread->is_Java_thread()) {
      // We are leaving the VM, set state to native (in case any OS exit
      // handlers call back to the VM)
      JavaThread* jt = (JavaThread*)thread;
      // Must always be walkable or have no last_Java_frame when in
      // thread_in_native
      jt->frame_anchor()->make_walkable(jt);
      jt->set_thread_state(_thread_in_native);
    }
  }
  notify_vm_shutdown();
}
void vm_perform_shutdown_actions() {
  // Warning: do not call 'exit_globals()' here. All threads are still running.
  // Calling 'exit_globals()' will disable thread-local-storage and cause all
  // kinds of assertions to trigger in debug mode.
  if (is_init_completed()) {
    Thread* thread = Thread::current();
    if (thread->is_Java_thread()) {
      JavaThread *jt = (JavaThread*)thread;
if(jt->jvm_locked_by_self()){
        // We are leaving the VM, unlock the JVM lock like we would if we were
        // running in native code.  (in case any OS exit handlers call back to
        // the VM)
jt->jvm_unlock_self();
      }
    }
  }
  notify_vm_shutdown();
}
Example #3
0
void vm_direct_exit(int code) {
  notify_vm_shutdown();
  ::exit(code);
}