﻿# Mutex

Mutex\. In programming, a unary [semaphore](https://pvs-studio.com/en/blog/terms/0043/), serving to synchronize simultaneously executed [threads](https://pvs-studio.com/en/blog/terms/0048/)\. Mutex can be in two states: locked and unlocked\. By associating mutex with hardware or software application resource you can provide correct access to the resources from several tasks \- if a task tries to get access to the locked resource it will be set into waiting state but will get control immediately after the resource is unlocked\.

## References

1. Wikipedia\. "[Mutual exclusion](https://en.wikipedia.org/wiki/Mutual_exclusion)"
1. Wikipedia\. "[Semaphore \(programming\)](https://en.wikipedia.org/wiki/Semaphore_(programming))"