provide lock only if there is no deadlock