interrupt() doesn't work
问题 I am trying to terminate the thread in the following code: public synchronized void run() { try { while (!Thread.currentThread().isInterrupted()) { this.scan(); this.distribute(); this.wait(); } } catch (InterruptedException e) {} } public void cancel() { this.interrupt(); } But the thread won't terminate. I used the debugger and found out that after the command this.interrupt() , the thread doesn't get interrupted (I put a watch on the expression this.isInterrupted() and it stays false ).