public @ CheckForNull ThreadType getBlockingThread ( ) { if ( state . waitingToLock == null && state . waitingOnLock == null ) { return null ; } for ( ThreadType thread : runtime . getThreads ( ) ) { if ( thread == this ) continue ; Set < ThreadLock > acquired = thread . getAcquiredLocks ( ) ; if ( acquired . isEmpty ( ) ) continue ; if ( acquired . contains ( state . waitingToLock ) || acquired . contains ( state . waitingOnLock ) ) { return thread ; } } return null ; }
Get thread blocking this threads execution .