< prev index next >

src/hotspot/share/prims/jvmtiEnv.cpp

Print this page




1084   JavaThread::send_async_exception(java_thread->threadObj(), e);
1085 
1086   return JVMTI_ERROR_NONE;
1087 
1088 } /* end StopThread */
1089 
1090 
1091 // Threads_lock NOT held
1092 // thread - NOT pre-checked
1093 jvmtiError
1094 JvmtiEnv::InterruptThread(jthread thread) {
1095   // TODO: this is very similar to JVM_Interrupt(); share code in future
1096   JavaThread* current_thread  = JavaThread::current();
1097   JavaThread* java_thread = NULL;
1098   ThreadsListHandle tlh(current_thread);
1099   jvmtiError err = JvmtiExport::cv_external_thread_to_JavaThread(tlh.list(), thread, &java_thread, NULL);
1100   if (err != JVMTI_ERROR_NONE) {
1101     return err;
1102   }
1103 
1104   Thread::interrupt(java_thread);
1105 
1106   return JVMTI_ERROR_NONE;
1107 } /* end InterruptThread */
1108 
1109 
1110 // Threads_lock NOT held
1111 // thread - NOT pre-checked
1112 // info_ptr - pre-checked for NULL
1113 jvmtiError
1114 JvmtiEnv::GetThreadInfo(jthread thread, jvmtiThreadInfo* info_ptr) {
1115   ResourceMark rm;
1116   HandleMark hm;
1117 
1118   JavaThread* current_thread = JavaThread::current();
1119   ThreadsListHandle tlh(current_thread);
1120 
1121   // if thread is NULL the current thread is used
1122   oop thread_oop = NULL;
1123   if (thread == NULL) {
1124     thread_oop = current_thread->threadObj();




1084   JavaThread::send_async_exception(java_thread->threadObj(), e);
1085 
1086   return JVMTI_ERROR_NONE;
1087 
1088 } /* end StopThread */
1089 
1090 
1091 // Threads_lock NOT held
1092 // thread - NOT pre-checked
1093 jvmtiError
1094 JvmtiEnv::InterruptThread(jthread thread) {
1095   // TODO: this is very similar to JVM_Interrupt(); share code in future
1096   JavaThread* current_thread  = JavaThread::current();
1097   JavaThread* java_thread = NULL;
1098   ThreadsListHandle tlh(current_thread);
1099   jvmtiError err = JvmtiExport::cv_external_thread_to_JavaThread(tlh.list(), thread, &java_thread, NULL);
1100   if (err != JVMTI_ERROR_NONE) {
1101     return err;
1102   }
1103 
1104   java_thread->interrupt();
1105 
1106   return JVMTI_ERROR_NONE;
1107 } /* end InterruptThread */
1108 
1109 
1110 // Threads_lock NOT held
1111 // thread - NOT pre-checked
1112 // info_ptr - pre-checked for NULL
1113 jvmtiError
1114 JvmtiEnv::GetThreadInfo(jthread thread, jvmtiThreadInfo* info_ptr) {
1115   ResourceMark rm;
1116   HandleMark hm;
1117 
1118   JavaThread* current_thread = JavaThread::current();
1119   ThreadsListHandle tlh(current_thread);
1120 
1121   // if thread is NULL the current thread is used
1122   oop thread_oop = NULL;
1123   if (thread == NULL) {
1124     thread_oop = current_thread->threadObj();


< prev index next >