< prev index next >
src/hotspot/share/prims/jvmtiEnv.cpp
Print this page
*** 2837,2855 ****
// info_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv::GetObjectMonitorUsage(jobject object, jvmtiMonitorUsage* info_ptr) {
! JavaThread* calling_thread = JavaThread::current();
! jvmtiError err = get_object_monitor_usage(calling_thread, object, info_ptr);
! if (err == JVMTI_ERROR_THREAD_NOT_SUSPENDED) {
! // Some of the critical threads were not suspended. go to a safepoint and try again
! VM_GetObjectMonitorUsage op(this, calling_thread, object, info_ptr);
VMThread::execute(&op);
! err = op.result();
! }
! return err;
} /* end GetObjectMonitorUsage */
//
// Field functions
--- 2837,2851 ----
// info_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv::GetObjectMonitorUsage(jobject object, jvmtiMonitorUsage* info_ptr) {
! // It need to perform at safepoint for gathering stable data
! // because monitor owner / waiters might not be suspended.
! VM_GetObjectMonitorUsage op(this, JavaThread::current(), object, info_ptr);
VMThread::execute(&op);
! return op.result();
} /* end GetObjectMonitorUsage */
//
// Field functions
< prev index next >