Question d’entretien chez Everforth Quinnox

What is reentrant lock in Java?

Réponse à la question d'entretien

Utilisateur anonyme

21 août 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.