diff --git a/src/share/vm/runtime/objectMonitor.cpp b/src/share/vm/runtime/objectMonitor.cpp index 94f4492d382a7dc0b1065052f27177da0d6f42b6..3e5733329088d634e1c7b34717b39e044294e3f2 100644 --- a/src/share/vm/runtime/objectMonitor.cpp +++ b/src/share/vm/runtime/objectMonitor.cpp @@ -381,6 +381,8 @@ void ATTR ObjectMonitor::enter(TRAPS) { { // Change java thread status to indicate blocked on monitor enter. JavaThreadBlockedOnMonitorEnterState jtbmes(jt, this); + Self->set_current_pending_monitor(this); + DTRACE_MONITOR_PROBE(contended__enter, this, object(), jt); if (JvmtiExport::should_post_monitor_contended_enter()) { JvmtiExport::post_monitor_contended_enter(jt, this); @@ -395,8 +397,6 @@ void ATTR ObjectMonitor::enter(TRAPS) { OSThreadContendState osts(Self->osthread()); ThreadBlockInVM tbivm(jt); - Self->set_current_pending_monitor(this); - // TODO-FIXME: change the following for(;;) loop to straight-line code. for (;;) { jt->set_suspend_equivalent();