Pregunta de entrevista de Salesforce

How would you implement a read/write lock for a table in a database?