도움말을 보면 아래와 같습니다.

아래 문장으로는 block 된 thread 를 깨워준다. 라는것 같은데요..

실제 몇몇 소스를 보니 호출시마다 toggle 처럼 pause 혹은 resume 을 수행하는것처럼 보입니다.

thread를 정지, 재시작 하고 싶을때 interrupt 만으로도 가능한가요?

아니면 wait, notify 로만 정지,재시작이 가능한건가요?

 

Posts an interrupt request to this Thread. The behavior depends on the state of this Thread:

  • Threads blocked in one of Object's wait() methods or one of Thread's join() or sleep() methods will be woken up, their interrupt status will be cleared, and they receive an InterruptedException.
  • Threads blocked in an I/O operation of an InterruptibleChannel will have their interrupt status set and receive an ClosedByInterruptException. Also, the channel will be closed.
  • Threads blocked in a Selector will have their interrupt status set and return immediately. They don't receive an exception in this case.