Top


定義場所(file name)

hotspot/src/share/vm/prims/jvmtiRawMonitor.cpp

名前(function name)

void JvmtiPendingMonitors::transition_raw_monitors() {

本体部(body)

  {- -------------------------------------------
  (1) (assert)
      ---------------------------------------- -}

      assert((Threads::number_of_threads()==1),
             "Java thread has not created yet or more than one java thread \
    is running. Raw monitor transition will not work");
      JavaThread *current_java_thread = JavaThread::current();
      assert(current_java_thread->thread_state() == _thread_in_vm, "Must be in vm");

  {- -------------------------------------------
  (1) 格納していた全 JvmtiRawMonitor に対して, JavaThread::current() を引数として raw_enter() を呼び出す
      (これにより, それらの owner をメインスレッドに変更する).
      ---------------------------------------- -}

      {
        ThreadBlockInVM __tbivm(current_java_thread);
        for(int i=0; i< count(); i++) {
          JvmtiRawMonitor *rmonitor = monitors()->at(i);
          int r = rmonitor->raw_enter(current_java_thread);
          assert(r == ObjectMonitor::OM_OK, "raw_enter should have worked");
        }
      }

  {- -------------------------------------------
  (1) JvmtiRawMonitor を格納していた GrowableArray を解放する.
      ---------------------------------------- -}

      // pending monitors are converted to real monitor so delete them all.
      dispose();
    }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.