hotspot/src/share/vm/prims/jvmtiEnvBase.cpp
changeset 4571 80b553bddc26
parent 3261 c7d5aae8d3f7
child 4573 6358f8c9ed3b
equal deleted inserted replaced
4569:f372ea9e5ed4 4571:80b553bddc26
   506 
   506 
   507 
   507 
   508 JavaThread *
   508 JavaThread *
   509 JvmtiEnvBase::get_JavaThread(jthread jni_thread) {
   509 JvmtiEnvBase::get_JavaThread(jthread jni_thread) {
   510   oop t = JNIHandles::resolve_external_guard(jni_thread);
   510   oop t = JNIHandles::resolve_external_guard(jni_thread);
   511   if (t == NULL || !t->is_a(SystemDictionary::thread_klass())) {
   511   if (t == NULL || !t->is_a(SystemDictionary::Thread_klass())) {
   512     return NULL;
   512     return NULL;
   513   }
   513   }
   514   // The following returns NULL if the thread has not yet run or is in
   514   // The following returns NULL if the thread has not yet run or is in
   515   // process of exiting
   515   // process of exiting
   516   return java_lang_Thread::thread(t);
   516   return java_lang_Thread::thread(t);
  1248 
  1248 
  1249   ResourceMark rm;
  1249   ResourceMark rm;
  1250   for (int i = 0; i < _thread_count; ++i) {
  1250   for (int i = 0; i < _thread_count; ++i) {
  1251     jthread jt = _thread_list[i];
  1251     jthread jt = _thread_list[i];
  1252     oop thread_oop = JNIHandles::resolve_external_guard(jt);
  1252     oop thread_oop = JNIHandles::resolve_external_guard(jt);
  1253     if (thread_oop == NULL || !thread_oop->is_a(SystemDictionary::thread_klass())) {
  1253     if (thread_oop == NULL || !thread_oop->is_a(SystemDictionary::Thread_klass())) {
  1254       set_result(JVMTI_ERROR_INVALID_THREAD);
  1254       set_result(JVMTI_ERROR_INVALID_THREAD);
  1255       return;
  1255       return;
  1256     }
  1256     }
  1257     fill_frames(jt, java_lang_Thread::thread(thread_oop), thread_oop);
  1257     fill_frames(jt, java_lang_Thread::thread(thread_oop), thread_oop);
  1258   }
  1258   }