multithreading - How to stop a java thread gracefully ...
2012-2-13 · Then in the code that runs in the thread, regularly do. if (stop) / end gracefully by breaking out of loop or whatever To stop the thread, set stop to true. I think you must do it manually this way. After all, only the code running in the thread has any idea what is and isn't graceful.
Get Price