8185164: GetOwnedMonitorInfo() returns incorrect owned monitor

The GetOwnedMonitorInfo() should not return a pending monitor

Reviewed-by: dholmes, dcubed, sspitsyn
This commit is contained in:
Yasumasa Suenaga 2017-08-07 12:34:21 -07:00
parent 7d3e2cd5a3
commit 8b26f53df7
4 changed files with 347 additions and 2 deletions

View file

@ -307,6 +307,8 @@ void ObjectMonitor::enter(TRAPS) {
{ // 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);
@ -321,8 +323,6 @@ void ObjectMonitor::enter(TRAPS) {
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();