Everpure interview question

How does locking work with semaphores?