It looks like your problem is stopping a thread asynchronously, by the initiative of some other thread (only this situation usually causes difficulties).
The whole thing is a controversial topic I don't want to discuss here. I a few words, I dislike how it's done in Java. Most people stop thread in a collaborative way, by using some member (Boolean "flag") which can polled by a thread to be stopped and set by a separate thread. Also,
Thread.interrupt
can be used, with, but with certain "buts". This is pretty well described in this article:
http://www.javamex.com/tutorials/threads/stopping_thread.shtml[
^].
Note that the technique of "queued condition" is mentioned in relation to the producer-consumer patters and the use of
blocking queue.
—SA