Semaphores as Mutexes
Semaphores must be initialized with a value representing the number of free resources: mutexes are a single-use resource.
Down() to acquire a resource; blocks if
no resource is available.
Up() to release a resource; wakes up one waiter, if any.
Mutexes are often called binary semaphores.
However, “real” mutexes have additional constraints on their use.