Mutex (source code)

= Mutex

An object with acquire and release operations that provides exclusive ownership to a participating <software thread>. Several source-code regions can acquire the same <mutex>; two different <mutex> objects do not exclude each other's users. The caller should enter its <critical section> only after successful acquisition and release ownership on every exit path. A <mutex> may make a waiting <software thread> sleep or use a <spinlock>; the interface and the waiting mechanism are distinct.<Operating Systems: Three Easy Pieces by Remzi H. Arpaci-Dusseau and others/Locks>{ref}