Pergunta de entrevista da empresa Chewy

How does volatile works in conjuction with thread safety.