Implement distributed lock.