Domanda di colloquio di Everforth Quinnox

What is reentrant lock in Java?

Risposta di colloquio

Anonimo

21 ago 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.