As opposed to semaphores, mutexes can only take two values, commonly referred to as locked or unlocked. Additionally, mutexes have ownership properties in the sense that only the thread that locks the mutex can unlock it. Think of it as a locking/unlocking mechanism with a single key, where a thread wishing to gain access to a single object. For instance, a code section or a resource needs to first gain access to an unlocked mutex, lock it and then access the object. If the thread trying to gain access to the mutex sees that the mutex is already locked, then the thread gets blocked and will wait until the mutex is unlocked by the thread that locked it.
A typical use of a mutex is to protect a critical section of the code that can be accessed from multiple threads. The critical section is a piece of code that needs to be completed without interruptions from other threads, or else the global/static data within that critical section could be misrepresented or get corrupted.
Mutexes have the following properties:
The figure below shows the mutex properties