Pergunta de entrevista da empresa GridGain

Implement a reentrant lock based on a CAS primitive.