This is a question taken K&B book.
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 answer int he book is "A".
But i feel none of the answers are correct...
When a thread is placed on a waitset for an object and when someother thread issues a notification or when the waiting time elapses the thread comes out of the waiting state and starts competing for the lock and after acquiring the lock ,only then it becmoes runnable..
since after wait and when competing for the lock it gets into a blocking state which is "not runnable" ...
iam i right on this ?? can anyone confirm my this...
Thanks.