# HG changeset patch # User dbuck # Date 1502509867 14400 # Node ID b55756ea22d8d48fd7f42eb9442a5b5b4f1429cc # Parent fbb8f75498f4b232dbe26ccc22f07bb1fd62e960 8185164: GetOwnedMonitorInfo() returns incorrect owned monitor Summary: The GetOwnedMonitorInfo() should not return a pending monitor Reviewed-by: dcubed diff -r fbb8f75498f4 -r b55756ea22d8 src/share/vm/runtime/objectMonitor.cpp --- a/src/share/vm/runtime/objectMonitor.cpp Fri Aug 11 03:30:28 2017 -0400 +++ b/src/share/vm/runtime/objectMonitor.cpp Fri Aug 11 23:51:07 2017 -0400 @@ -381,6 +381,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); @@ -395,8 +397,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();