Improved waiting for ReentrantLock