Locking mechanism implemented. java.util.concurrent.locks.Lock interface
and it's ReentrantLock implementation is used.