< prev index next >

src/hotspot/share/prims/jvmtiEnv.cpp

Print this page

        

*** 1712,1732 **** // It's fine to update the thread state here because no JVMTI events // shall be posted for this PopFrame. // It is only safe to perform the direct operation on the current ! // thread. All other usage needs to use a vm-safepoint-op for safety. if (java_thread == JavaThread::current()) { state->update_for_pop_top_frame(); } else { ! VM_UpdateForPopTopFrame op(state); ! VMThread::execute(&op); ! jvmtiError err = op.result(); if (err != JVMTI_ERROR_NONE) { return err; } } java_thread->set_popframe_condition(JavaThread::popframe_pending_bit); // Set pending step flag for this popframe and it is cleared when next // step event is posted. state->set_pending_step_for_popframe(); --- 1712,1735 ---- // It's fine to update the thread state here because no JVMTI events // shall be posted for this PopFrame. // It is only safe to perform the direct operation on the current ! // thread. All other usage needs to use a handshake for safety. ! { ! MutexLocker mu(JvmtiThreadState_lock); if (java_thread == JavaThread::current()) { state->update_for_pop_top_frame(); } else { ! UpdateForPopTopFrameClosure op(state); ! bool executed = Handshake::execute_direct(&op, java_thread); ! jvmtiError err = executed ? op.result() : JVMTI_ERROR_THREAD_NOT_ALIVE; if (err != JVMTI_ERROR_NONE) { return err; } } + } java_thread->set_popframe_condition(JavaThread::popframe_pending_bit); // Set pending step flag for this popframe and it is cleared when next // step event is posted. state->set_pending_step_for_popframe();
*** 1794,1810 **** assert(vf->frame_pointer() != NULL, "frame pointer mustn't be NULL"); // It is only safe to perform the direct operation on the current // thread. All other usage needs to use a vm-safepoint-op for safety. if (java_thread == JavaThread::current()) { int frame_number = state->count_frames() - depth; state->env_thread_state(this)->set_frame_pop(frame_number); } else { ! VM_SetFramePop op(this, state, depth); ! VMThread::execute(&op); ! err = op.result(); } return err; } /* end NotifyFramePop */ --- 1797,1814 ---- assert(vf->frame_pointer() != NULL, "frame pointer mustn't be NULL"); // It is only safe to perform the direct operation on the current // thread. All other usage needs to use a vm-safepoint-op for safety. + MutexLocker mu(JvmtiThreadState_lock); if (java_thread == JavaThread::current()) { int frame_number = state->count_frames() - depth; state->env_thread_state(this)->set_frame_pop(frame_number); } else { ! SetFramePopClosure op(this, state, depth); ! bool executed = Handshake::execute_direct(&op, java_thread); ! err = executed ? op.result() : JVMTI_ERROR_THREAD_NOT_ALIVE; } return err; } /* end NotifyFramePop */
< prev index next >