Pergunta de entrevista da empresa Apple

Difference between semaphor, lock, and control variables.