How a thread should close itself in Java?
- by Roman
This is a short question. At some point my thread understand that it should suicide. What is the best way to do it:
Thread.currentThread().interrupt();
return;
By the way, why in the first case we need to use currentThread? Is Thread does not refer to the current thread?