ReentrantLock
An explicit Java mutual-exclusion lock that allows the owning thread to acquire the same lock repeatedly and offers capabilities beyond synchronized.
Technical Context
ReentrantLock supports tryLock, interruptible acquisition, optional fairness, and multiple Condition objects. The engineering cost is explicit lifecycle management: every successful lock acquisition must be paired with unlock in a finally block.
Related Concepts
- synchronized
- Condition
- fair lock
- critical section