2017 December

Terminate Java Thread

The best way to terminate a Java thread is with a switch such as a boolean property, .e.g abort. As soon as a condition is met, usually a timeout, you can change the value of abort to true and thus exit thread. Example: import java.util.concurrent.*; public class CheckResults { private static int counter = 0;… read more »