changeset 8423:b55756ea22d8

8185164: 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 fbb8f75498f4
children cc5c5ad8dd1c
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	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();