Why you do not try to use sleep(long timeout) when are waiting for some condition and if had not success, you simple "return" from the thread?
Probably your thread is running in a while (booleanVariable) { }
,
if it is, you could set this variable as volatile, and the thread controller set it as false.
Think of the Thread.stop()
like the System.exit(value)
, it works, but when you have some bug making you thread stop/vm exit, will be much more harder to find it out.