Mercurial > hg > truffle
comparison src/share/vm/runtime/objectMonitor.cpp @ 17965:4a1062dc52d1
8036823: Stack trace sometimes shows 'locked' instead of 'waiting to lock'
Summary: Add a !owner check for 'waiting to lock' to catch current_pending_monitor corner cases.
Reviewed-by: dholmes, sspitsyn, kmo, zgu
Contributed-by: rednaxelafx@gmail.com, zhengyu.gu@oracle.com, daniel.daugherty@oracle.com
author | dcubed |
---|---|
date | Wed, 04 Jun 2014 06:25:53 -0700 |
parents | a7d4d4655766 |
children | 52b4284cb496 ce8f6bb717c9 |
comparison
equal
deleted
inserted
replaced
17964:660b3f6bf7d7 | 17965:4a1062dc52d1 |
---|---|
416 exit (false, Self) ; | 416 exit (false, Self) ; |
417 | 417 |
418 jt->java_suspend_self(); | 418 jt->java_suspend_self(); |
419 } | 419 } |
420 Self->set_current_pending_monitor(NULL); | 420 Self->set_current_pending_monitor(NULL); |
421 | |
422 // We cleared the pending monitor info since we've just gotten past | |
423 // the enter-check-for-suspend dance and we now own the monitor free | |
424 // and clear, i.e., it is no longer pending. The ThreadBlockInVM | |
425 // destructor can go to a safepoint at the end of this block. If we | |
426 // do a thread dump during that safepoint, then this thread will show | |
427 // as having "-locked" the monitor, but the OS and java.lang.Thread | |
428 // states will still report that the thread is blocked trying to | |
429 // acquire it. | |
421 } | 430 } |
422 | 431 |
423 Atomic::dec_ptr(&_count); | 432 Atomic::dec_ptr(&_count); |
424 assert (_count >= 0, "invariant") ; | 433 assert (_count >= 0, "invariant") ; |
425 Self->_Stalled = 0 ; | 434 Self->_Stalled = 0 ; |