Previously we implemented a thread safe counter using synchronized. We would like to swift from synchronized blocks to something more flexible with more features, this is were locks are of use. On this blog we will focus on Java’s Lock interface. The Lock interface supports three forms of lock acquisition interruptible, non-interruptible, and timed. We …