How to interrupt a BlockingQueue which is blocking on take()?

If interrupting the thread is not an option, another is to place a “marker” or “command” object on the queue that would be recognized as such by MyObjHandler and break out of the loop.

Leave a Comment