Java 1.5 introduces the Lock interface with its java.util.concurrent package, which contains a lot of concurrency-related classes. It achieves the same goal as that of synchronized but allows you to control manually the scope of the synchronized code.
As Lock is an interface, it needs an implementation. The JRE comes with a default implementation called ReentrantLock. Replacing a synchronized block ...