Everpure Interview Question

How does locking work with semaphores?