Page 1 of 1

About Question enthuware.ocpjp.v8.2.1099 :

Posted: Thu Mar 17, 2016 4:57 pm
by Russtam
The thread that has called the wait() will not come out of WAITING state until some other thread calls notify or notifyAll on the same object or interrupts the thread.
From JavaDoc:
As in the one argument version, interrupts and spurious wakeups are possible, and this method should always be used in a loop:
synchronized (obj) {
while (<condition does not hold>)
obj.wait();
... // Perform action appropriate to condition
}
I think its need to add "or spurious wakeups" to option.

Re: About Question enthuware.ocpjp.v8.2.1099 :

Posted: Sat Mar 19, 2016 10:08 am
by admin
Added.
thank you for your feedback!