public int getWaiting ( ) { if ( ! hasWaiters ( ) ) return 0 ; Iterator < RegisteredSignal > iter = queue . iterator ( ) ; int count = 0 ; while ( iter . hasNext ( ) ) { Signal next = iter . next ( ) ; if ( ! next . isCancelled ( ) ) count ++ ; } return count ; }
Return how many threads are waiting