Pergunta de entrevista da empresa MathWorks

This simple program is not thread-safe. Make it thread-safe.