Top


定義場所(file name)

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

名前(function name)

JvmtiDeferredEvent JvmtiDeferredEventQueue::dequeue() {

本体部(body)

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

      assert(Service_lock->owned_by_self(), "Must own Service_lock");

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

      process_pending_events();

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

      assert(_queue_head != NULL, "Nothing to dequeue");

  {- -------------------------------------------
  (1) (_queue_head が NULL というケースは (HotSpot 内にバグがなければ) 起こらないはずだが, 
       念のため JvmtiDeferredEvent() を返すようにしておく)
      ---------------------------------------- -}

      if (_queue_head == NULL) {
        // Just in case this happens in product; it shouldn't but let's not crash
        return JvmtiDeferredEvent();
      }

  {- -------------------------------------------
  (1) _queue_head から先頭の QueueNode を取り出す.
      ---------------------------------------- -}

      QueueNode* node = _queue_head;
      _queue_head = _queue_head->next();
      if (_queue_head == NULL) {
        _queue_tail = NULL;
      }

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

      assert((_queue_head == NULL) == (_queue_tail == NULL),
             "Inconsistent queue markers");

  {- -------------------------------------------
  (1) 取り出した QueueNode を delete し, その中に入っていた JvmtiDeferredEvent だけをリターンする.
      ---------------------------------------- -}

      JvmtiDeferredEvent event = node->event();
      delete node;
      return event;
    }

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