Java / Java Multithreading
Explain IllegalMonitorStateException in Java multi-threading.
This run-time exception is thrown to indicate that a thread has attempted to wait on an object's monitor or to notify other threads waiting on an object's monitor without owning the specified monitor.
It is mandatory that a thread cannot call wait(), notify() or notifyAll() without holding the lock on the object the method is called on. Usually both the waiting or notifying threads call wait() and notify() from within a synchronized block or method.
More Related questions...