8185164: GetOwnedMonitorInfo() returns incorrect owned monitor

Fri, 11 Aug 2017 23:51:07 -0400

author
dbuck
date
Fri, 11 Aug 2017 23:51:07 -0400
changeset 8887
b55756ea22d8
parent 8886
fbb8f75498f4
child 8888
cc5c5ad8dd1c

8185164: GetOwnedMonitorInfo() returns incorrect owned monitor
Summary: The GetOwnedMonitorInfo() should not return a pending monitor
Reviewed-by: dcubed

src/share/vm/runtime/objectMonitor.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/runtime/objectMonitor.cpp	Fri Aug 11 03:30:28 2017 -0400
     1.2 +++ b/src/share/vm/runtime/objectMonitor.cpp	Fri Aug 11 23:51:07 2017 -0400
     1.3 @@ -381,6 +381,8 @@
     1.4    { // Change java thread status to indicate blocked on monitor enter.
     1.5      JavaThreadBlockedOnMonitorEnterState jtbmes(jt, this);
     1.6  
     1.7 +    Self->set_current_pending_monitor(this);
     1.8 +
     1.9      DTRACE_MONITOR_PROBE(contended__enter, this, object(), jt);
    1.10      if (JvmtiExport::should_post_monitor_contended_enter()) {
    1.11        JvmtiExport::post_monitor_contended_enter(jt, this);
    1.12 @@ -395,8 +397,6 @@
    1.13      OSThreadContendState osts(Self->osthread());
    1.14      ThreadBlockInVM tbivm(jt);
    1.15  
    1.16 -    Self->set_current_pending_monitor(this);
    1.17 -
    1.18      // TODO-FIXME: change the following for(;;) loop to straight-line code.
    1.19      for (;;) {
    1.20        jt->set_suspend_equivalent();

mercurial