--- old/src/share/vm/runtime/objectMonitor.cpp 2017-08-07 09:27:46.218684854 +0900 +++ new/src/share/vm/runtime/objectMonitor.cpp 2017-08-07 09:27:46.124682919 +0900 @@ -307,6 +307,8 @@ { // 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); @@ -321,8 +323,6 @@ 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();