Pergunta de entrevista da empresa Texas Instruments

What is purpose of semaphore in OS?