comparison src/share/vm/prims/jvmtiEnvBase.cpp @ 8883:b9a918201d47

Merge with hsx25
author Gilles Duboscq <duboscq@ssw.jku.at>
date Sat, 06 Apr 2013 20:04:06 +0200
parents 5fc51c1ecdeb 5ee250974db9
children 6b2d8d20ecbd
comparison
equal deleted inserted replaced
8660:d47b52b0ff68 8883:b9a918201d47
995 // This monitor is owned so we have to find the owning JavaThread. 995 // This monitor is owned so we have to find the owning JavaThread.
996 // Since owning_thread_from_monitor_owner() grabs a lock, GC can 996 // Since owning_thread_from_monitor_owner() grabs a lock, GC can
997 // move our object at this point. However, our owner value is safe 997 // move our object at this point. However, our owner value is safe
998 // since it is either the Lock word on a stack or a JavaThread *. 998 // since it is either the Lock word on a stack or a JavaThread *.
999 owning_thread = Threads::owning_thread_from_monitor_owner(owner, !at_safepoint); 999 owning_thread = Threads::owning_thread_from_monitor_owner(owner, !at_safepoint);
1000 assert(owning_thread != NULL, "sanity check"); 1000 // Cannot assume (owning_thread != NULL) here because this function
1001 if (owning_thread != NULL) { // robustness 1001 // may not have been called at a safepoint and the owning_thread
1002 // might not be suspended.
1003 if (owning_thread != NULL) {
1002 // The monitor's owner either has to be the current thread, at safepoint 1004 // The monitor's owner either has to be the current thread, at safepoint
1003 // or it has to be suspended. Any of these conditions will prevent both 1005 // or it has to be suspended. Any of these conditions will prevent both
1004 // contending and waiting threads from modifying the state of 1006 // contending and waiting threads from modifying the state of
1005 // the monitor. 1007 // the monitor.
1006 if (!at_safepoint && !JvmtiEnv::is_thread_fully_suspended(owning_thread, true, &debug_bits)) { 1008 if (!at_safepoint && !JvmtiEnv::is_thread_fully_suspended(owning_thread, true, &debug_bits)) {
1009 // Don't worry! This return of JVMTI_ERROR_THREAD_NOT_SUSPENDED
1010 // will not make it back to the JVM/TI agent. The error code will
1011 // get intercepted in JvmtiEnv::GetObjectMonitorUsage() which
1012 // will retry the call via a VM_GetObjectMonitorUsage VM op.
1007 return JVMTI_ERROR_THREAD_NOT_SUSPENDED; 1013 return JVMTI_ERROR_THREAD_NOT_SUSPENDED;
1008 } 1014 }
1009 HandleMark hm; 1015 HandleMark hm;
1010 Handle th(owning_thread->threadObj()); 1016 Handle th(owning_thread->threadObj());
1011 ret.owner = (jthread)jni_reference(calling_thread, th); 1017 ret.owner = (jthread)jni_reference(calling_thread, th);