What is a mutex?

What is a mutex?

Approach: Define mutual exclusion object.

A synchronization primitive used to grant exclusive access to a shared resource to only one thread at a time.

Follow-up: Difference between a mutex and a semaphore?

Key concepts: locking, shared resources, threads.