public void stopAllInputProcessing ( ) { ProcessThread threadProcess ; synchronized ( inputStreams ) { threadProcess = this . threadProcess ; if ( threadProcess != null ) { if ( threadProcess . running ) { threadProcess . requestStop = true ; } else { threadProcess = this . threadProcess = null ; } } } inputSizeKnown = false ; if ( threadProcess == null ) { return ; } long timeout = System . currentTimeMillis ( ) + 5000 ; while ( threadProcess . running && timeout >= System . currentTimeMillis ( ) ) { synchronized ( inputStreams ) { if ( threadProcess != this . threadProcess ) { throw new RuntimeException ( "BUG! the thread got modified by anotehr process" ) ; } } BoofMiscOps . sleep ( 100 ) ; } if ( timeout < System . currentTimeMillis ( ) ) throw new RuntimeException ( "Took too long to stop input processing thread" ) ; this . threadProcess = null ; }
Blocks until it kills all input streams from running