previous |
start |
next
Terminating Threads
- A thread's run method should check occasionally
whether it has been interrupted
- Use the isInterrupted method
- An interrupted thread should release resources, clean up, and
exit
- The sleep method throws an InterruptedException when a
sleeping thread is interrupted
- Catch the exception
- Terminate the thread
previous |
start |
next