hotspot/src/share/vm/services/management.cpp
changeset 25949 34557722059b
parent 25057 f38210f84f8c
child 25960 729cd80956ae
equal deleted inserted replaced
25948:9b33776f4f07 25949:34557722059b
  1912 
  1912 
  1913   EXCEPTION_MARK;
  1913   EXCEPTION_MARK;
  1914   ResourceMark rm(THREAD); // thread->name() uses ResourceArea
  1914   ResourceMark rm(THREAD); // thread->name() uses ResourceArea
  1915 
  1915 
  1916   assert(thread->name() != NULL, "All threads should have a name");
  1916   assert(thread->name() != NULL, "All threads should have a name");
  1917   _names_chars[_count] = strdup(thread->name());
  1917   _names_chars[_count] = os::strdup(thread->name());
  1918   _times->long_at_put(_count, os::is_thread_cpu_time_supported() ?
  1918   _times->long_at_put(_count, os::is_thread_cpu_time_supported() ?
  1919                         os::thread_cpu_time(thread) : -1);
  1919                         os::thread_cpu_time(thread) : -1);
  1920   _count++;
  1920   _count++;
  1921 }
  1921 }
  1922 
  1922 
  1930   }
  1930   }
  1931 }
  1931 }
  1932 
  1932 
  1933 ThreadTimesClosure::~ThreadTimesClosure() {
  1933 ThreadTimesClosure::~ThreadTimesClosure() {
  1934   for (int i = 0; i < _count; i++) {
  1934   for (int i = 0; i < _count; i++) {
  1935     free(_names_chars[i]);
  1935     os::free(_names_chars[i]);
  1936   }
  1936   }
  1937   FREE_C_HEAP_ARRAY(char *, _names_chars, mtInternal);
  1937   FREE_C_HEAP_ARRAY(char *, _names_chars, mtInternal);
  1938 }
  1938 }
  1939 
  1939 
  1940 // Fills names with VM internal thread names and times with the corresponding
  1940 // Fills names with VM internal thread names and times with the corresponding