changeset 6576:f631660ef0a3

8185164, PR3433: GetOwnedMonitorInfo() returns incorrect owned monitor Summary: The GetOwnedMonitorInfo() should not return a pending monitor Reviewed-by: dcubed
author dbuck
date Fri, 11 Aug 2017 23:51:07 -0400
parents f3d363f40e8b
children 3413fb2061fb
files src/share/vm/runtime/objectMonitor.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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();