Skip to content

Glossary: Rust Beyond the Basics

Mutex

Also written: Mutex<T>, lock, mutual exclusion

A lock that lets only one thread or task at a time reach the value inside. `lock()` waits for its turn and returns a guard; dropping the guard releases the lock.

Where the book teaches it

Related terms

poisoningdeadlockguard