/** * Get the thread who's lock is blocking the given thread. * A null is returned if there is no such thread. * * @param blockedThread the blocked thread * @return the blocking thread, or null if * there is none * @throws NullPointerException * if the blocked thread is null */
public
static Thread getBlockingThread( final Thread blockedThread ) { final ThreadInfo info = getThreadInfo( blockedThread ); if ( info == null ) return
null; final
long id = info.getLockOwnerId( ); if ( id == -1 ) return
null; return getThread( id ); } }