public class MyClass extends Thread{
public void run() {
try {
while(!Thread.currentThread().isInterrupted()) {
// ...
}
} catch (InterruptedException consumed)
/* Allow thread to exit */
}
}
public void cancel() { interrupt(); }
//etc.
}
Should I always call cancel() like this before deconstructing the object for some reason, or should I not worry about it?