Title: (Optional) Suspend, resume, and stop threads.
Course: Java Programming (Oracle) (10055) > Section: Understanding Multithreaded Programming Support

Threads should be designed so that the run( ) method periodically checks to see if the thread should suspend, resume, or stop its own execution, which is usually accomplished by establishing two-flag variables, one flag for suspend and resume, and one flag for stop, and the following rules:

- If set to running, run( ) must continue to let the thread execute.
- If set to suspend, the thread must pause.
- If set to stop, the thread must terminate.