Search code examples
javamultithreadingjava.util.concurrentconcurrencyinterrupted-exception

await method of class Condition not throwing InterruptedException


I have strange issue with an await method of Condition class in Java SE 6. The problem is that await method NOT always throws an exception while interrupting by another thread.

In documentation it is written that the IE is thrown when:

... Some other thread interrupts the current thread, and interruption of thread suspension is supported ...

How to interpret this subsentense: "and interruption of thread suspension is supported"

It seams to be imposible to not throwing an exception. Do you ever had similar problem ?


Solution

  • Its not impossible not to throw InterruptedException what if the object has received signal via signal or signalAll API, the spec says these two methods will wake up any threads which are waiting on this condition.