I know that this is ill advised but still i am trying to look into a method of interrupting a thread which hangs, from another thread which is keeping time.
What i do is: I start the monitor thread just before a questionable network operation is about to happen. This thread is supposed to monitor the time elapsed since it was started and if the time exceeds some threshold value, it kills the thread that initially started it. In order to inform this new thread , which thread is to be killed , the object of the new thread , is passed an object of the Thread to be monitored.
In a nutshell, this is what happens :
A creates B , B creates C , B tells C about itself , C keeps time , if time expires C kills B (I pass the details to C after in B's run method using "currentThread()" and I have confirmed that the correct object is indeed being passed)
Now, the problem is that , this , is not working , for some reason , the call to B.interrupt() is killing C itself.
[Note : Uppercase letters denote thread names]