A lock protects a shared resource by allowing only one call to execute its protected code at a time while other calls wait. This prevents concurrent updates but can cause deadlocks or unnecessary delays when used incorrectly. section 7.7.2
A reentrant lock lets the thread that already holds a lock acquire it again. The nested operation can proceed instead of waiting for its own thread to release the lock. section 7.7.4
Nested cache operations
Suppose set acquires a write lock and then calls evictOneEntry. If evictOneEntry also acquires that write lock, a non-reentrant lock makes the thread wait for a lock that set cannot release until the call returns. A reentrant lock permits the nested acquisition, allowing eviction to finish and avoiding this deadlock. section 7.7.4

