void reset ( ) { if ( ! hasStopped ) { throw new IllegalStateException ( "cannot reset a non stopped queue poller" ) ; } hasStopped = false ; run = true ; lastLoop = null ; loop = new Semaphore ( 0 ) ; }
Will make the thread ready to run once again after it has stopped .