|Webopedia: In computer programming, a mutex is a program object that allows multiple program threads to share the same resource, such as file access, but not simultaneously. |
When a program is started, a mutex is created with a unique name. After this stage, any thread that needs the resource must lock the mutex from other threads while it is using the resource. The mutex is set to unlock when the data is no longer needed or the routine is finished.