# HG changeset patch # User dbuck # Date 1502509867 14400 # Node ID f631660ef0a31022922261463ab3376a3ee50311 # Parent f3d363f40e8b9a8ad26b3b3e9d113d31d72cf2b9 8185164, PR3433: GetOwnedMonitorInfo() returns incorrect owned monitor Summary: The GetOwnedMonitorInfo() should not return a pending monitor Reviewed-by: dcubed diff -r f3d363f40e8b -r f631660ef0a3 src/share/vm/runtime/objectMonitor.cpp --- a/src/share/vm/runtime/objectMonitor.cpp Mon Sep 11 19:03:30 2017 +0100 +++ b/src/share/vm/runtime/objectMonitor.cpp Fri Aug 11 23:51:07 2017 -0400 @@ -379,6 +379,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); @@ -393,8 +395,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();