If a thread goes to sleep
A. It releases all the locks it has.
B. It does not release any locks.
C. It releases half of its locks.
D. It releases all of its lock except one.
Answer:B
If a thread goes to sleep
A. It releases all the locks it has. B. It does not release any locks. C. It releases half of its locks. D. It releases all of its lock except one.
Explanation: The sleep() method does not release any locks of an object for a specific time or until an interrupt occurs. It leads to the poor performance or deadlock of threads. Whereas, the wait() method does not release the locks of an object.