hotspot/src/share/vm/runtime/thread.cpp
changeset 27656 edf22ab2020b
parent 27651 b85a7f15f835
parent 27654 4e508c2376f7
child 27917 c5937f7b4e8b
child 27880 afb974a04396
equal deleted inserted replaced
27653:4c2e88d870ed 27656:edf22ab2020b
  2825 // descriptive string if there is no set name
  2825 // descriptive string if there is no set name
  2826 const char* JavaThread::get_thread_name_string(char* buf, int buflen) const {
  2826 const char* JavaThread::get_thread_name_string(char* buf, int buflen) const {
  2827   const char* name_str;
  2827   const char* name_str;
  2828   oop thread_obj = threadObj();
  2828   oop thread_obj = threadObj();
  2829   if (thread_obj != NULL) {
  2829   if (thread_obj != NULL) {
  2830     typeArrayOop name = java_lang_Thread::name(thread_obj);
  2830     oop name = java_lang_Thread::name(thread_obj);
  2831     if (name != NULL) {
  2831     if (name != NULL) {
  2832       if (buf == NULL) {
  2832       if (buf == NULL) {
  2833         name_str = UNICODE::as_utf8((jchar*) name->base(T_CHAR),
  2833         name_str = java_lang_String::as_utf8_string(name);
  2834                                     name->length());
       
  2835       } else {
  2834       } else {
  2836         name_str = UNICODE::as_utf8((jchar*) name->base(T_CHAR),
  2835         name_str = java_lang_String::as_utf8_string(name, buf, buflen);
  2837                                     name->length(), buf, buflen);
       
  2838       }
  2836       }
  2839     } else if (is_attaching_via_jni()) { // workaround for 6412693 - see 6404306
  2837     } else if (is_attaching_via_jni()) { // workaround for 6412693 - see 6404306
  2840       name_str = "<no-name - thread is attaching>";
  2838       name_str = "<no-name - thread is attaching>";
  2841     } else {
  2839     } else {
  2842       name_str = Thread::name();
  2840       name_str = Thread::name();