Which statements are true about locks?.
Select the two correct answers.
wait()
on a Thread object will relinquish all locks held by the thread.wait()
on an object whose lock is held by the current thread will relinquish the lock.notify()
on a object whose lock is held by the current thread will relinquish the lock.(a) and (c)
A thread can hold multiple locks; e.g., by nesting synchronized blocks.
Invoking the wait()
method on an object whose lock is held by the current thread will relinquish the lock for the duration of the call.
The notify()
method does not relinquish any locks.