Skip to content
Advertisement

I was searching for stopping java thread gracefully and found that, but I cannot know how to check example of this situation

This is good example of stopping thread. How to stop a java thread gracefully?
But when I try to check this example I received infinite loop.

This is my code:

JavaScript
JavaScript

Advertisement

Answer

I think you need to start your thread – not run it. By calling run, you are just making a normal method call, not running a separate thread.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement