Bai Shen wrote:Yup. It starts and then waits for a thread interrupt. Nothing ever comes. And none of the threads ever cancel before they start.
How do you 'wait for the interrupt? Usually, methods that throw an InterruptedException will reset the interrupted flag (meaning the thread's isInterrupted() method returns false after catching an InterruptedException). So using wait() or sleep() and catching the InterruptedException would essentially make sure the isInterrupted() flag is not true.
You would have to re-set it in the catch block if you want the interrupted state to be seen: