Texas Instruments interview question

Application question of using semaphore