src/share/vm/runtime/vframe.cpp

changeset 6708
4a1062dc52d1
parent 6680
78bbf4d43a14
child 6876
710a3c8b516e
child 7215
c204e2044c29
equal deleted inserted replaced
6707:660b3f6bf7d7 6708:4a1062dc52d1
197 } 197 }
198 } 198 }
199 continue; 199 continue;
200 } 200 }
201 if (monitor->owner() != NULL) { 201 if (monitor->owner() != NULL) {
202 // the monitor is associated with an object, i.e., it is locked
202 203
203 // First, assume we have the monitor locked. If we haven't found an 204 // First, assume we have the monitor locked. If we haven't found an
204 // owned monitor before and this is the first frame, then we need to 205 // owned monitor before and this is the first frame, then we need to
205 // see if we have completed the lock or we are blocked trying to 206 // see if we have completed the lock or we are blocked trying to
206 // acquire it - we can only be blocked if the monitor is inflated 207 // acquire it - we can only be blocked if the monitor is inflated
207 208
208 const char *lock_state = "locked"; // assume we have the monitor locked 209 const char *lock_state = "locked"; // assume we have the monitor locked
209 if (!found_first_monitor && frame_count == 0) { 210 if (!found_first_monitor && frame_count == 0) {
210 markOop mark = monitor->owner()->mark(); 211 markOop mark = monitor->owner()->mark();
211 if (mark->has_monitor() && 212 if (mark->has_monitor() &&
212 mark->monitor() == thread()->current_pending_monitor()) { 213 ( // we have marked ourself as pending on this monitor
214 mark->monitor() == thread()->current_pending_monitor() ||
215 // we are not the owner of this monitor
216 !mark->monitor()->is_entered(thread())
217 )) {
213 lock_state = "waiting to lock"; 218 lock_state = "waiting to lock";
214 } 219 }
215 } 220 }
216 221
217 found_first_monitor = true; 222 found_first_monitor = true;

mercurial