http://saurabhsinhainblogs.blogspot.in/2014/02/difference-between-mutex-vs-semaphore.html
https://www.geeksforgeeks.org/mutex-vs-semaphore/
mutex is locking mechanism
while semaphore is signaling mechanism
.
mutex controls access to resources - ownership
semaphore controls signaling of available resources - signaling mechanism to tell other process the resource required is ready or available.
the toilet: only one toilet and one key to toilet, only one person could use that toilet with that only key. Other people must wait for the release of the resource: toilet key to use that toilet.
So the code to control that only one person with the key at a time to use that toilet - mutex - controls ownership
the code to inform other process whether the toilet is free or occupied - binary semaphore - controls the signaling of ownership status