Mutexes

Creating a Mutex

A mutex provides mutual exclusive access to a resource. Once a thread has access to a resource, all other threads that request access to that resource are blocked.

Note:

If several threads are waiting for the mutex when the resource becomes available, there is no guarantee as to which thread will get access first.