jjzjj

blockingThread

全部标签

java - Thread.isInterrupted() 在线程终止后返回 false

考虑以下JUnit测试:@TestpublicvoidtestSettingInterruptFlag()throwsInterruptedException{ThreadblockingThread=newThread(newRunnable(){@Overridepublicsynchronizedvoidrun(){try{wait();}catch(InterruptedExceptione){Thread.currentThread().interrupt();}}});blockingThread.start();blockingThread.interrupt();blo