Thread Synchronization - Mutexes If several threads need to access the same data structure, we need to make sure they don't all try to access it at once - or else they might corrupt it (since context switching can happen at any given time). We protect such 'critical sections' using a mutex. A mutex is an object that can be locked and unlocked. Trying to lock an already-locked mutex, will block the caller until the mutex is unlocked by some other thread. If several threads try to lock the same mutex at the same time, we are guaranteed that only one will succeed - the rest will block on the locking operation.