@ Handler ( priority = - 10000 ) public void onStop ( Stop event ) throws InterruptedException { synchronized ( this ) { if ( runner == null ) { return ; } // It just might happen that the wakeup() occurs between the // check for running and the select() in the thread's run loop, // but we -- obviously -- cannot put the select() in a // synchronized(this). while ( runner . isAlive ( ) ) { runner . interrupt ( ) ; // *Should* be sufficient, but... selector . wakeup ( ) ; // Make sure runner . join ( 10 ) ; } runner = null ; } }
Stops the thread that is associated with this dispatcher .