private void interruptThread(Thread t) {
   if (t != null) {
     t.interrupt();
   }
 }