Replaces lock with juc.ReentrantLock