How does `ReentrantLock` improve thread synchronization in Java?
`ReentrantLock` provides better control over thread synchronization, allowing features like timed lock acquisition, interruptible lock waits, and lock ownership tracking.
Great! Youâ€™ve nailed it. `ReentrantLock` offers more flexibility compared to `synchronized` blocks.
Can you explain how `tryLock()` works in `ReentrantLock` and how it helps avoid blocking indefinitely?