After invoking the wait method on an object, obj1, a thread, T1, will remain in the wait set of obj1 until which of the following occurs?
a. Another thread invokes the notify method on the object, obj1, and T1 is selected to move out of the wait set
b. Another thread invokes the notifyAll method on the object
c. Another thread invokes the resume method on thread T1
d. Another thread interrupts thread T1
e. The priority of thread T1 is increased
f. A specified timeout period has elapsed
g. Another thread invokes the join method on thread T1
The correct answers are a,b,d,f.
I'm having trouble with the b). I thought that notifyAll
only notifies all of the threads waiting in the pool of the object but in order to get out of the pool the
thread must be chosen by the scheduler to move to the running state... Am I missing something?
TIA,
Bojan