Everforth Quinnox Interview Question

What is reentrant lock in Java?

Interview Answer

Anonymous

Aug 21, 2024

Reentrant Locks are provided in Java to provide synchronization with greater flexibility. The code which manipulates the shared resource is surrounded by calls to lock and unlock method. This gives a lock to the current working thread and blocks all other threads which are trying to take a lock on the shared resource.