What is the purpose of the ReentrantLock in Java?

Last Updated :
Discuss
Comments

What is the purpose of the ReentrantLock in Java?

It provides an atomic way of accessing a shared resource

It supports interruptible lock acquisition

It uses volatile variables to prevent race conditions

It synchronizes method calls automatically

Share your thoughts in the comments