1.1 --- a/src/share/vm/runtime/vframe.cpp Fri May 30 10:43:51 2014 +0200 1.2 +++ b/src/share/vm/runtime/vframe.cpp Wed Jun 04 06:25:53 2014 -0700 1.3 @@ -199,6 +199,7 @@ 1.4 continue; 1.5 } 1.6 if (monitor->owner() != NULL) { 1.7 + // the monitor is associated with an object, i.e., it is locked 1.8 1.9 // First, assume we have the monitor locked. If we haven't found an 1.10 // owned monitor before and this is the first frame, then we need to 1.11 @@ -209,7 +210,11 @@ 1.12 if (!found_first_monitor && frame_count == 0) { 1.13 markOop mark = monitor->owner()->mark(); 1.14 if (mark->has_monitor() && 1.15 - mark->monitor() == thread()->current_pending_monitor()) { 1.16 + ( // we have marked ourself as pending on this monitor 1.17 + mark->monitor() == thread()->current_pending_monitor() || 1.18 + // we are not the owner of this monitor 1.19 + !mark->monitor()->is_entered(thread()) 1.20 + )) { 1.21 lock_state = "waiting to lock"; 1.22 } 1.23 }