My Google skills seem to have failed me, so apologies if this is a simple question.
I simply want to interrupt (“kill” it I guess) the thread which I am currently running.
My class implements Runnable, and inside the run() method I want the thread to interrupt if a certain condition is met.
Cheers! 🙂
One other option depending on the context. Thread.interrupt will likely be better, but this one might be useful too by just introducing a cancel boolean inside your class.