In K&B's
Java 2 SCP&D certification book, chapter 9, self
test question 13...
13. Assume the following method is properly synchronized and called from a
thread A on an object B:
wait(2000);
After calling this method, when will the thread A become a candidate to get another turn at
the CPU?
A. After thread A is notified, or after two seconds.
B. After the lock on B is released, or after two seconds.
C. Two seconds after thread A is notified.
D. Two seconds after lock B is released.
The correct answer as given in the key is 'A'.
My question is, would it be more accurate to say:
'(After thread A is notified AND the lock on B is released) OR after two seconds.'?
Once thread A is notified isn't it possible for thread A to be blocked on B's lock for a short period of time until the synchronized code in B is finished executing. What am I missing here?
Thanks,
-Dave-