Add a method to wait for the lock to clear