Hello.
C) A thread is busy within a while(true){} loop doing its fine works. Check a parameter in the while condition instead of true that you can set from the outside. while(a==0) {} with "a" being a public variable in your thread class. Setting "a" to 1 will terminate your thread after the current loop finished.
A) A thread is waiting on some object by calling someobject.wait(); Wrap the wait() inside a loop as described in C, and specify a timeout for wait, e.g. someobject.wait(5000); to wait 5 seconds. Then you can
test an abort condition in the while() and you can even set a timeout inside your thread class when the loop has run a certain number of times without the wait() being interrupted by notify(). You have to catch InterruptedException that tells you whether wait() got a timeout (5000 ms) or an interruption.
B) A thread is being Blocked on IO routin, say network stream read and write. I do not know. I think, blocked means blocked. You cannot do much besides waiting outside the thread for the execution of the IO request and proceed if a timeout occurs. Maybe the thread gets deleted when the reference is deleted but I don't think so.
Christian Wolf
[edit 2]
[ January 19, 2004: Message edited by: Christian Wolf ]