Exploring What’s Inside java.util.concurrent Package (Part 2)

Ruby Valappil
Javarevisited
Published in
4 min readFeb 22, 2022

--

Interfaces in locks package

The above image shows the interfaces that are included in the java.util.concurrent.locks package.

In Part 1 of this series, we explored the contents inside the java.util.concurrent package. If you haven’t already, I would recommend reading that part first.

Interfaces and Classes in this package define a framework for locking and waiting for conditions that are different from the built-in synchronization and thus providing greater flexibility.

Let’s take a look at the Lock Interface and its implementation classes.

Lock implementation provides the flexibility to attain and release locks at different scopes. For example, the synchronized method or blocks apply the lock over the complete object and the release and acquisition of a lock is performed in a block-structured way.

--

--