412 * or {@link java.lang.Thread.State#TIMED_WAITING TIMED_WAITING} state. 413 * 414 * @return the total number of times that the thread 415 * was in the <tt>WAITING</tt> or <tt>TIMED_WAITING</tt> state. 416 */ 417 public long getWaitedCount() { 418 return waitedCount; 419 } 420 421 /** 422 * Returns the <tt>LockInfo</tt> of an object for which 423 * the thread associated with this <tt>ThreadInfo</tt> 424 * is blocked waiting. 425 * A thread can be blocked waiting for one of the following: 426 * <ul> 427 * <li>an object monitor to be acquired for entering or reentering 428 * a synchronization block/method. 429 * <br>The thread is in the {@link java.lang.Thread.State#BLOCKED BLOCKED} 430 * state waiting to enter the <tt>synchronized</tt> statement 431 * or method. 432 * <p></li> 433 * <li>an object monitor to be notified by another thread. 434 * <br>The thread is in the {@link java.lang.Thread.State#WAITING WAITING} 435 * or {@link java.lang.Thread.State#TIMED_WAITING TIMED_WAITING} state 436 * due to a call to the {@link Object#wait Object.wait} method. 437 * <p></li> 438 * <li>a synchronization object responsible for the thread parking. 439 * <br>The thread is in the {@link java.lang.Thread.State#WAITING WAITING} 440 * or {@link java.lang.Thread.State#TIMED_WAITING TIMED_WAITING} state 441 * due to a call to the 442 * {@link java.util.concurrent.locks.LockSupport#park(Object) 443 * LockSupport.park} method. The synchronization object 444 * is the object returned from 445 * {@link java.util.concurrent.locks.LockSupport#getBlocker 446 * LockSupport.getBlocker} method. Typically it is an 447 * <a href="LockInfo.html#OwnableSynchronizer"> ownable synchronizer</a> 448 * or a {@link java.util.concurrent.locks.Condition Condition}.</li> 449 * </ul> 450 * 451 * <p>This method returns <tt>null</tt> if the thread is not in any of 452 * the above conditions. 453 * 454 * @return <tt>LockInfo</tt> of an object for which the thread 455 * is blocked waiting if any; <tt>null</tt> otherwise. 456 * @since 1.6 457 */ | 412 * or {@link java.lang.Thread.State#TIMED_WAITING TIMED_WAITING} state. 413 * 414 * @return the total number of times that the thread 415 * was in the <tt>WAITING</tt> or <tt>TIMED_WAITING</tt> state. 416 */ 417 public long getWaitedCount() { 418 return waitedCount; 419 } 420 421 /** 422 * Returns the <tt>LockInfo</tt> of an object for which 423 * the thread associated with this <tt>ThreadInfo</tt> 424 * is blocked waiting. 425 * A thread can be blocked waiting for one of the following: 426 * <ul> 427 * <li>an object monitor to be acquired for entering or reentering 428 * a synchronization block/method. 429 * <br>The thread is in the {@link java.lang.Thread.State#BLOCKED BLOCKED} 430 * state waiting to enter the <tt>synchronized</tt> statement 431 * or method. 432 * </li> 433 * <li>an object monitor to be notified by another thread. 434 * <br>The thread is in the {@link java.lang.Thread.State#WAITING WAITING} 435 * or {@link java.lang.Thread.State#TIMED_WAITING TIMED_WAITING} state 436 * due to a call to the {@link Object#wait Object.wait} method. 437 * </li> 438 * <li>a synchronization object responsible for the thread parking. 439 * <br>The thread is in the {@link java.lang.Thread.State#WAITING WAITING} 440 * or {@link java.lang.Thread.State#TIMED_WAITING TIMED_WAITING} state 441 * due to a call to the 442 * {@link java.util.concurrent.locks.LockSupport#park(Object) 443 * LockSupport.park} method. The synchronization object 444 * is the object returned from 445 * {@link java.util.concurrent.locks.LockSupport#getBlocker 446 * LockSupport.getBlocker} method. Typically it is an 447 * <a href="LockInfo.html#OwnableSynchronizer"> ownable synchronizer</a> 448 * or a {@link java.util.concurrent.locks.Condition Condition}.</li> 449 * </ul> 450 * 451 * <p>This method returns <tt>null</tt> if the thread is not in any of 452 * the above conditions. 453 * 454 * @return <tt>LockInfo</tt> of an object for which the thread 455 * is blocked waiting if any; <tt>null</tt> otherwise. 456 * @since 1.6 457 */ |