Skip to content

Glossary: Software Design Patterns in Rust

Mutex

Also written: Mutex<T>, lock

A lock that lets one thread or piece of code at a time use the value inside. It is how Rust allows a changeable `static`, via `lock().unwrap()`.

Where the book teaches it

Related terms

Global mutable stateSingletonData race