raise an exception if the lock is not acquired