Anonymous Content interview question

Difference between lock and semaphores