The Java documentation I use makes it clear that the Object.wait() method requests a linked monitor before returning it, whether it has been notified or is a false wakeup; any return to the normal method will precede the re-registration of the monitor.
However, it is a little less clear what will happen in the Object.wait() event throws an exception, for example, Interrupted Exception . I assume that it really reloads the lock before throwing an exception. However, the documentation is not very clear, so I'm not 100% sure ...
Here is the document I'm looking at: http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html#wait%28%29
So, is my conclusion really correct, or should my call code address the state of the monitor (for example, if necessary, if necessary) after an exception is thrown?
source share