Top


定義場所(file name)

hotspot/src/share/vm/services/management.cpp

名前(function name)

static void initialize_ThreadInfo_constructor_arguments(JavaCallArguments* args, ThreadSnapshot* snapshot, TRAPS) {

本体部(body)

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

      Handle snapshot_thread(THREAD, snapshot->threadObj());

      jlong contended_time;
      jlong waited_time;
      if (ThreadService::is_thread_monitoring_contention()) {
        contended_time = Management::ticks_to_ms(snapshot->contended_enter_ticks());
        waited_time = Management::ticks_to_ms(snapshot->monitor_wait_ticks() + snapshot->sleep_ticks());
      } else {
        // set them to -1 if thread contention monitoring is disabled.
        contended_time = max_julong;
        waited_time = max_julong;
      }

      int thread_status = snapshot->thread_status();
      assert((thread_status & JMM_THREAD_STATE_FLAG_MASK) == 0, "Flags already set in thread_status in Thread object");
      if (snapshot->is_ext_suspended()) {
        thread_status |= JMM_THREAD_STATE_FLAG_SUSPENDED;
      }
      if (snapshot->is_in_native()) {
        thread_status |= JMM_THREAD_STATE_FLAG_NATIVE;
      }

      ThreadStackTrace* st = snapshot->get_stack_trace();
      Handle stacktrace_h;
      if (st != NULL) {
        stacktrace_h = st->allocate_fill_stack_trace_element_array(CHECK);
      } else {
        stacktrace_h = Handle();
      }

      args->push_oop(snapshot_thread);
      args->push_int(thread_status);
      args->push_oop(Handle(THREAD, snapshot->blocker_object()));
      args->push_oop(Handle(THREAD, snapshot->blocker_object_owner()));
      args->push_long(snapshot->contended_enter_count());
      args->push_long(contended_time);
      args->push_long(snapshot->monitor_wait_count() + snapshot->sleep_count());
      args->push_long(waited_time);
      args->push_oop(stacktrace_h);
    }

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