How would you implement a distributed lock?

Technical