Pregunta de entrevista de Blink22

How would you handle race conditions in a multi-threaded environment?