, , .... Java- Object.notifyAll()
IllegalArgumentException - if the value of timeout is negative.
IllegalMonitorStateException - if the current thread is not the owner of the object monitor.
InterruptedException - if any thread interrupted the current thread before or while the current thread was waiting for a notification. The interrupted status of the current thread is cleared when this exception is thrown.
, , Object, .
: a private final Object doneLock = new Object(). Done doneLock. , , .
,
synchronize(doneLock) {
done = true;
doneLock.notifyAll();
}