Question 9 Which of the following allows a thread t1 to become the holder of the lock of object obj1.
a. By blocking on I/O b. By entering a synchronized instance method of the obj1 c. By invoking the wait method on the object d. By entering the body of a block that is synchronized on obj1 e. By entering a synchronized static method of the obj1 f. By invoking the notify method on obj1
The answer given is a,b,d,f. I am not able to justify on 'f'. How can choice 'f' make t1 to be the holder of obj1. obj1.notify() will alert one thread and NOT all threads waiting for obj1. So, how can you say for sure that obj1 will be locked by t1 ONLY ???
Please explain! Thanks! [ October 30, 2004: Message edited by: Barry Gaunt ]