Broadcom interview question

How will you implement locks in a system?