public static void execute ( Thread thread , long timeout ) { thread . start ( ) ; try { thread . join ( timeout ) ; } catch ( InterruptedException e ) { // Should not be interrupted normally. } if ( thread . isAlive ( ) ) { thread . interrupt ( ) ; } }
Executes the thread with specified timeout .