# HG changeset patch # User kevinw # Date 1379526644 -7200 # Node ID 8c84f04ff977f33286f66dd5b2a0e69f17e87c19 # Parent 63147986a4284a0797ffc73ac9aed20c5a6a9631# Parent c1d7040a1183c907c622cafa388f17fe541322bc Merge diff -r 63147986a428 -r 8c84f04ff977 src/share/vm/prims/jvmtiEnvBase.hpp --- a/src/share/vm/prims/jvmtiEnvBase.hpp Wed Sep 18 07:02:10 2013 -0700 +++ b/src/share/vm/prims/jvmtiEnvBase.hpp Wed Sep 18 19:50:44 2013 +0200 @@ -406,7 +406,11 @@ VMOp_Type type() const { return VMOp_GetCurrentContendedMonitor; } jvmtiError result() { return _result; } void doit() { - _result = ((JvmtiEnvBase *)_env)->get_current_contended_monitor(_calling_thread,_java_thread,_owned_monitor_ptr); + _result = JVMTI_ERROR_THREAD_NOT_ALIVE; + if (Threads::includes(_java_thread) && !_java_thread->is_exiting() && + _java_thread->threadObj() != NULL) { + _result = ((JvmtiEnvBase *)_env)->get_current_contended_monitor(_calling_thread,_java_thread,_owned_monitor_ptr); + } } };