Page 1 of 1

About Question enthuware.ocpjp.v7.2.1522 :

Posted: Mon Feb 15, 2016 4:09 am
by Nisim123
Sorry for such a silly comment, but still option 2 {Thread T2's wait() times out.} sounds not bad at all...
after all it says that thread T2 called the obj.wait() method- so it does hold the lock for the object obj,
Then it says at the 2nd part of the question that Thread T1 also holds the lock on object obj.
I can just suppose that T1 is still processing object obj, otherwise it sound like a deadlock or something.... :?

Re: About Question enthuware.ocpjp.v7.2.1522 :

Posted: Mon Feb 15, 2016 5:28 am
by admin
If thread T2 has called the obj.wait() method, why do you think it will still have the lock for the object obj?
Wait releases the lock.