Crypto.com interview question

Explain some locking mechanisms to avoid race conditions.