is there anyway to kill a thread or interrupt it immediately.
Like in one of my thread, i call a method which takes time to execute (2-4 seconds). This method is in a wh
No, I don't believe there is a way. There's a reason you don't want to do that.
Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?
If you need the thread stop earlier you need to put more break points in your thread.
You can use stop() to styop it immediately, but this comes at a cost and has many possible undesirable side effects. You can use stop() safely with great care, but in reality you will find it simpler/easier/safer to put in more break points (points where you check if the thread should stop)
BTW, If you want to throw an error which won't be printed you can ThreadDeath as this can shutdown the thread silently.