It seems this problem has been mentioned on the Google Code forums:
The problem seems to occur because the tick [producer] thread doesn't play well with the debugger.
It's suggesting that problems occur with the debugger when you have 2 threads (a producer and a consumer thread), and you attempt to suspend the consumer thread.
The workaround:
If you put a breakpoint to pause the tick thread, then you can step through both test threads nicely.
This suggests that you should set a breakpoint within the producer thread (not the consumer thread). Apprently the timeout occured when putting a breakpoint on the consumer thread, and putting a breakpoint on both threads caused an IllegalStateException
.
I hope this helps!
The idea is to block the producer thread, which forces the consumer thread to wait (assuming it's blocked while waiting for data, not polling). You can then resume the producer thread, which resumes the consumer thread for that "tick". The producer thread goes back to waiting.
Apparently, it takes 2 of these cycles to represent 1 "tick", as suggested by the person who found the workaround:
When they're both blocked waiting for a tick, you can release the tick thread until
one of the test threads is released, and then leave the tick thread blocked again
until you need the next tick. It seems to take two cycles of the tick thread to
advance one tick.