コード例 #1
0
 public static void trigger() {
   syncInterrupt.lock();
   if (allowInterrupt) {
     myThread.interrupt();
   } else {
     triggered = true;
   }
   syncInterrupt.unlock();
 }
コード例 #2
0
 public static void main(String[] args) {
   ThreadInterruptDemo test = new ThreadInterruptDemo();
   MyThread thread = test.new MyThread();
   thread.start();
   try {
     Thread.currentThread().sleep(2000);
   } catch (InterruptedException e) {
     e.printStackTrace();
   }
   thread.interrupt();
 }
コード例 #3
0
ファイル: VisualizeView.java プロジェクト: 2014-1/001
 @Override
 public void surfaceDestroyed(SurfaceHolder holder) {
   mThread.interrupt();
 }